I'm changing some old js I had to use jQuery.

I used to have a function like this (to select a certain text input on
a form and automatically focus on it) ... :

window.onload = function() {
       self.focus();
       
document.getElementById("userresponse").setAttribute("autocomplete","off");
       document.getElementById("userresponse").focus();
}

which worked fine ... then I replace it with this:

$(function () {
       self.focus();
       $("#userresponse").setAttribute("autocomplete","off");
       $("#userresponse").focus();
});

which fails to select the text box. why not? I thought these were
equivalent excpet the jQuery version loads sooner?

thanks

Daniel


-- 
Daniel McBrearty
email : danielmcbrearty at gmail.com
www.engoi.com : the multi - language vocab trainer
BTW : 0873928131

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to