Which is fast document.getElementByID('txtName') or $('#txtName').?
Answer Posted / 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 |
Post New Answer View All Answers
Explain the difference between jquery-x.x.x.js and jquery.x.x.x min.js?
What are the slow selectors in jquery? : jquery mobile
Is jQuery is a replacement of JavaScript?
Explain the types of selectors in jquery?
Tell me what are the slow selectors in jquery? : jquery mobile
Difference between parent() and parents() in jQuery?
Name 3 available jquery plugins that bootstrap has in their query plugin library.
How to redirect to another page using jquery?
Explain the difference between body onload() and document.ready() function? : jquery mobile
Explain the basic need to start with jquery? : jquery mobile
How did you become the creator of jquery ui? Whats the story behind that?
Does jquery 2.0 supports ie? : jquery mobile
What is the use of serialize method in jQuery?
Tell me which command will give a version of jquery?
Is vanilla js faster than jquery?