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

Tell me how to select combobox select value and text using jquery?

437


What is jQuery CDN?

510


How to get the value of selected option in jquery?

478


What are the browser related issues for jQuery?

476


How to get/set the html contents of an element using jQuery?

500






what are the features of jquery

475


What is the starting point of code execution in jquery?

439


Explain the difference between event.preventdefault and "return false"? : jquery mobile

479


differentiate between bind() vs live() vs delegate() methods in jquery.

444


What is resize() function in jquery?

518


What features of jquery, has been used in web applications?

463


Can you please explain the difference between body onload() and document.ready() function? : jquery mobile

418


Explain the difference between .empty() and .remove() ?

453


How can we include jQuery library in ASP.Net project?

480


What are the different type of selectors in jquery?

456