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
What is the use of val() method in jquery?
How to concatenate two strings using jquery?
Differentiate between width() vs css(‘width’) in jquery
Can you use multiple document.ready() function on the same page?
Explain various methods to make ajax request in jquery? : jquery mobile
What is the difference between onclick and onsubmit?
What are the browser related issues for jQuery?
How is body onload() function is different from document.ready() function used in jquery?
How method can be called inside code behind using jQuery?
What does the jQuery migrate function do?
How can jquery library be added to pages?
How did you become the creator of jquery ui? Whats the story behind that?
How to programmatically trigger a click event thats being handled by jquery only?
Which sign is used as a shortcut for jQuery?
How to increase cursor size in html body using jquery?