Faster: document.getElementByID('txtName'); because 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.
Tell me the difference for below two functions
$(document).ready(function() { alert("Function using Document Ready"); }
vs
$(function() { alert("Normal function"); }