selecting a select list in jquery

Posted by tessa on Stack Overflow See other posts from Stack Overflow or by tessa
Published on 2010-04-07T14:17:50Z Indexed on 2010/04/07 14:23 UTC
Read the original article Hit count: 322

Filed under:

There has to be something really simple that I am overlooking, but for some reason I cannot find any information about this and it keeps coming up so..

I am trying to select a select element in jquery. Right now I don't care about it's options, I just want the select element. If I have the following element:

<select id="testSelect"><option>1</option></select>

and I use jquery to select it:

var selectElement = $("#testSelect");

I get an array of all the options in the select list, but not the select element itself. What am I missing?

© Stack Overflow or respective owner

Related posts about jQuery