I'm interested in writing a very generic script that I can include into my masterpage that would give focus to the first textbox on the page, regardless of the page layout and contents. Would something like this work?
$(function() {
$("input[type='text']:first").focus();
});
I'm worried that "first" is just whatever is the first textbox it finds using whatever indexing mechanism jquery uses internally rather than the first textbox (ie. top-most, left-most on the screen)
Thanks!