Bug Tracker

Modify

Ticket #8371 (closed bug: invalid)

Opened 2 years ago

Last modified 2 years ago

compatibility error

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

Description

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

<html>
<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);
}
</script>
<body>
<select id="idSelect">
	<option>123-item1</option><option>456-item2</option><option>789-item3</option>
</select><br/>
<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
</body>
</html>

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

Change History

comment:1 Changed 2 years ago by naitsir

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

comment:2 Changed 2 years ago by rwaldron

  • Status changed from new to closed
  • Resolution set to invalid

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:

 http://api.jquery.com/attribute-equals-selector/

comment:3 Changed 2 years ago by jitter

  • Priority changed from undecided to low
  • Component changed from unfiled to selector

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.