background image
HomeRecent PostsDrupalSearchTagsRSSContactAboutAccount

Focusing your cursor on the first form input of each page using jQuery

Eric.London's picture

To improve usability, I wanted to place the user's cursor on the first form input of each page when the document loads. Here's the JQuery I used...

<?php
$(document).ready(function(){
  $(
"input").not("[@type='hidden']")[0].focus();
});
?>