ok, I got it. To access the element I need to access $('#id')[0] What confused me here is that I wasn't really clear what the "jquery object" actually is. I have looked through the various intro and tutorial material a few times, and managed to get the library to do some useful things, but I missed this.
Is there anywhere where this is explained? thanks Daniel On 1/15/07, Daniel McBrearty <[EMAIL PROTECTED]> wrote: > sorry ... not the smartest question. of course, one returns the > element, one returns the jquery object. > > What I needed was $('#id').attr( { autocomplete : "off" } ); > > I still have a problem to set the focus though. There is no error shown for > > $('#id').focus(); > > but the focus is not set ... > > > On 1/15/07, Daniel McBrearty <[EMAIL PROTECTED]> wrote: > > 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 > > > > > -- > Daniel McBrearty > email : danielmcbrearty at gmail.com > www.engoi.com : the multi - language vocab trainer > BTW : 0873928131 > -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/