Insights on Ruby, Git, jQuery, Cappuccino, WordPress, Debian and OS X. Please subscribe if you find something useful!

jQuery – Set Mouse Focus On Page Load

Posted: May 9th, 2009 | Author: Jerod | Filed under: jQuery | Tags: | Comments

First Input:

$(document).ready(function() {
  $('input:text:first').focus();
});

First Empty Input:

$(document).ready(function() {
  $('input:text[value=""]:first').focus();
});

blog comments powered by Disqus