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


Please Help Members By Posting Answers For Below Questions

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

468


What are features of jquery or what can be done using jquery?

409


Why is not dom ready working for jquery mobile? : jquery mobile

447


What is the difference between find and children methods in jquery?

825


Is numeric in jquery?

455






What is event.PreventDefault in jQuery?

520


Define bind() and unbind elements in jQuery?

552


Explain the starting point of code execution in jquery? : jquery mobile

472


What are the advantages of jQuery?

478


Define the types of selectors in jquery?

421


Difference between detach and remove? : jQuery Mobile

454


Define data paremeter of jquery ajax method?

463


What are the guidelines for an application to follow the principles of progressive enhancement.

458


Tell me is jquery a library for client scripting or server scripting? : jquery mobile

462


Whether C# code behind can be called from jQuery?

483