Which is fast document.getElementByID('txtName') or $('#txtName').?
Answer / chaitanya
Native JavaScipt is always fast. jQuery method to select txtName "$('#txtName')" will internally makes a call to document.getElementByID('txtName'). As jQuery is written on top of JavaScript and it internally uses JavaScript only So JavaScript is always fast.
| Is This Answer Correct ? | 0 Yes | 0 No |
What are the different type of selectors in jquery?
What is the advantage of using the minified version of jquery rather than using the conventional one?
What is resize() function in jquery?
How to check if number is numeric while using jquery 1.7+? : jquery mobile
What is serialize() in jquery?
Do we need to add the jquery file both at the master page and content page as well?
Write a basic jquery code?
Why jQuery is better than JavaScript?
How to set jquery mobile responsive table width to 100% width despite css styles? : jquery mobile
Tell me is jquery a w3c standard? : jquery mobile
Which are the fastest selectors in jquery? : jquery mobile
Explain the difference between .js and .min.js? : jquery mobile