views:

37

answers:

2

The normal way to do this would be:

var resultSelect = document.getElementById("resultSelect");
resultSelect.size = 3;

How do i do this in jQuery?

Thanks in advance

+2  A: 

Something like:

$("#resultSelect").attr('size', '3');
kchau
Thanks for the quick answers everyone. I have to attribute the answer to kchau for jumping in there first
superspace
Thanks @superspace. :-)
kchau
+2  A: 
$('#mySelect').attr('size', value)

Using jQuery, how can I dynamically set the size attribute of a select box?

Pranay Rana
Thanks for the link. That question didn't pop up as one of the suggestions when i wrote the question :(
superspace