Why is my HTML Select box in Opera Browser not behaving?
I have a simple select element on my page:
<select id="info_routes" size="10"></select>
This select box gets populated at page load via jquery at document ready:
for (var route in _routes) {
var val = _routes[route].id;
var key = 'route_'+val;
$("<option />").attr({id: key, value: val}).appendTo('#info_routes');
$('#info_routes > #'+key).text(_routes_text(_routes[route]));
}
The result is:
<select id="info_routes" size="10">
<option id="route_1" value="1">9 - Two Nations Crossing</option>
<option id="route_2" value="2">13S - Prospect</option>
<option id="route_3" value="3">13N - Brookside Mall</opti开发者_运维问答on>
...
</select>
The problem is when this element is rendered in Opera 10 this happens:
See attached photo here http://tinypic.com/r/n4yrk9/4 (Note, I used tinypic.com, please excuse the abundance of ads I picked the first free image hosting site I found on google)
It behaves as if the apple-command/pc-ctrl button is being held :(
This is not supposed to be a multi-select element, yet the items remain selected after another item is selected. Also the first item when selected doesn't highlight at all.
Any ideas as to why this is happening and how to remedy it would be much appreciated!
I can't reproduce your problem using Opera10 (XP, no widgets) - the result code you posted gives a single select dropdown.
Try to paste your code into w3schools - tryit window and see what it does there
any fancy widgets loaded?
good luck MikeD
http://www.w3schools.com/TAGS/att_select_multiple.asp
Try disabling this so that only one option can be selected at a time.
More info on option selects: http://www.w3schools.com/TAGS/att_option_selected.asp http://www.w3schools.com/TAGS/tag_option.asp
Other than that, I would look at something else causing it.
精彩评论