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 $(this) and 'this' in jquery?
What does jQuery data() function do?
How to add or remove classes to an element in jquery?
How to add a class to html element?
What are the different ways of using $.connect function in jquery?
Create a plugin that would add and remove a class on hover.
How can events be prevented to work after an ajax request?
How to find grand children in of an element?
Define jquery connect?
Can you please explain the difference between prop and attr? : jquery mobile
Explain the script build up by jquery?
What are the paremeter of jquery ajax method?
How can we show and hide an element via jquery?
How to use transition effects? : jQuery Mobile
What is cdn and how jquery is related to it?