0

Defaulting the cursor to the First input box on any page.

Cool Stuff, javascript

Here's a short and simple  javascript using Jquery to put the cursor in the first text box on a web page.  I added this to one of our sites to make sure the cursor starts in the different forms / search boxes on all the pages of our site.


<script>
  document.ready(function()){
   $("input[type='text']:first").select();
  };
</script>

It's using Jquery to find the FIRST :  INPUT tag with a TYPE="TEXT" on the page.  Then it selects it to move the cursor.

 

tags:
jquery, input

Search

Jeff   Roberson