jQuery: The Write Less, Do More JavaScript Library

Re: How to do a document.getElementById("mytextbo").select() in jquery?

by Karl Rudd :: Rate this Message:

Reply to Author | View in Thread


$("#mytextbo")[0].select();

jQuery(selectorString), or the "shortcut" $(selectorString), always
return an array like object. To "run" the select() on it you have to
access one of the "raw" elements it contains, hence the [0], which
retrieves the first element in the "array".

Karl Rudd

On Tue, May 13, 2008 at 12:19 PM,  <eric.advincula@...> wrote:
>
>  I've been searching and i'm not quite sure how to do it.  Anyone else
>  know how? Thanks

 « Return to Thread: How to do a document.getElementById("mytextbo").select() in jquery?