Which is fast document.getElementByID('txtName') or $('#txtName').?



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

Post New Answer

More jQuery Interview Questions

Tell me can we have multiple document.ready() function on the same page? : jquery mobile

0 Answers  


How can related code be encapsulated? Give example.

0 Answers  


Is it possible that jquery html work for both html and xml document?

0 Answers  


Define width() vs css('width')?

0 Answers  


What are the various ajax functions?

0 Answers  






What is each() function in jQuery? How do you use it?

0 Answers  


Explain finish method in jquery? : jquery mobile

0 Answers  


How do I check if an HTML element is empty using jQuery?

0 Answers  


What to do to select element having a particular class (".selected")? : jquery mobile

0 Answers  


What is $() in jquery library?

0 Answers  


Is jQuery is a client or server scripting?

0 Answers  


What are jquery plugins?

0 Answers  


Categories