Skip to main content

Bug Tracker

Side navigation

#8371 closed bug (invalid)

Opened February 24, 2011 03:56PM UTC

Closed February 24, 2011 04:01PM UTC

Last modified February 24, 2011 08:10PM UTC

compatibility error

Reported by: naitsir Owned by:
Priority: low Milestone:
Component: selector Version: 1.5
Keywords: Cc:
Blocked by: Blocking:

there are a little error to select an item from a <select></select> object on Firefox and Google Chrome.

the selection works without double quotes on ie, ff, and googlechrome, but with double quote only works on ie.

please, check the code

<script language="JavaScript" src="jquery-1.5.min.js"></script>
<script type="text/javascript">
function changeItemIEFF(){//works on ie,ff,gc
	//here we use 456 to search the item (without doble quotes)
	$('#idSelect option[text*=456]').attr('selected',true);
function changeItemIE(){//only works on ie
	//here we use "456" to search the item (with doble quotes)
	$('#idSelect option[text*="456"]').attr('selected',true);
<select id="idSelect">
<button onclick="changeItemIEFF();">change to item 2</button> works on ie8, ff3.6.12, googlechrome 9.0.597 <br/>
<button onclick="changeItemIE();">change to item 2</button> only works on ie8. NOT on firefox and google chrome 9.0.597

thank you for your time and sorry for my english :S


Attachments (0)
Change History (3)

Changed February 24, 2011 04:00PM UTC by naitsir comment:1

i forgot to mention, search only works with numbers on ff and google chrome.

Changed February 24, 2011 04:01PM UTC by rwaldron comment:2

resolution: → invalid
status: newclosed

Thanks for taking the time to contribute to the jQuery project!

A quick look at the API will show you that the quotes are required:

Changed February 24, 2011 08:10PM UTC by jitter comment:3

component: unfiledselector
priority: undecidedlow