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 what are the slow selectors in jquery? : jquery mobile

0 Answers  


How you get server response from an ajax request using jquery?

0 Answers  


What are the difference between alert() and confirm()?

0 Answers  


Is jquery still relevant 2019?

0 Answers  


How can jquery library be added to pages?

0 Answers  






What is .siblings() method in jquery?

0 Answers  


Define the use of each function in jquery?

0 Answers  


How you will use jquery means requirement needed for using jquery.

0 Answers  


What are the the two types of cdns?

0 Answers  


What is the advantage of using protocol less URL while referencing jQuery from CDNs?

1 Answers  


Explain the difference between javascript and jquery? : jquery mobile

0 Answers  


Difference between javascript and jquery?

0 Answers   HCL,


Categories