HTML: Prevent hide of options in select
Is it possible not to hide options when I select item in 'select'? I need to append more options to 'select' when user click on 'op2' item, but without closing option list.开发者_JAVA百科
<select>
<option>op1</option>
<option>op2</option>
</select>
This is an HTML option : size="x"
<select id="test" size="5">
<option>op1</option>
<option>op2</option>
<option>op3</option>
<option>op4</option>
<option>op5</option>
<option>op6</option>
</select>
You can then set the said size using jQuery :
$("select#test").attr("size",$("select#test > option").length);
DEMO HERE
<select multiple>
might be what you want.
精彩评论