I tried to use focus for first input field on the form. but it doesn\'t work. When I call attr(\"id\") for that input it worked. When I call focus f
focus
attr(\"id\")
use
$(document).ready(function() { // focus on the first text input field in the first field on the page $("input[type='text']:first", document.forms[0]).focus(); });