jQuery stay focused!
June 6th, 2008
Filed under: Food for thought
This is really just something for all you new jQuery learners, if you want to keep the cursor inside of a text box, even if you click elsewhere on the page, you can do this:
//Initial focus on #inputfieldid
$(”#inputfieldid”).focus();
//When you click anywhere it focuses back on #inputfieldid
$(this).click(function(){
$(”#inputfieldid”).focus();
});








Leave a Reply