Which is the fastest, document.getElementByID(‘txtName’) or $(‘#txtName’).?

Native JavaScipt is always fast. The jQuery method to select txtName “$(‘#txtName’)” will internally make a call to document.getElementByID(‘txtName’). Since jQuery is written on top of JavaScript and it internally uses JavaScript only, JavaScript is always fast.

Read More