Bug Tracker

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#9734 closed bug (invalid)

":enabled" works in Firefox but not in IE7

Reported by: sunnyramon@… Owned by:
Priority: high Milestone: 1.next
Component: selector Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:

Description

In IE7, the whole body background changed the color.

<html>
<head>
<script type="text/javascript" src="jquery-1.6.1.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $(":enabled").css("background-color","red");
});
</script>
</head>
<body>

<form action="">
Name: <input type="text" name="user" />
<br />
ID:<input type="text" name="id" disabled="disabled" />
Age:
<select disabled="disabled">
<option>20-30</option>
<option>30-50</option>
<option>50+</option>
</select>
<input type="submit" />
</form>

</body>
</html>

Change History (4)

comment:1 Changed 8 years ago by timmywil

Component: unfiledsupport
Priority: undecidedhigh
Status: newopen

Confirmed, but in the meantime I suggest using a tagName with filters, such as

$('input:enabled, select:enabled')

This is more performant and has the advantage of not affecting elements that do not have a disabled property.

comment:3 Changed 8 years ago by john

Resolution: invalid
Status: openclosed

I agree with timmywil, you should really limit this to just the specific elements that you want highlighted.

comment:4 Changed 8 years ago by john

Component: supportselector
Note: See TracTickets for help on using tickets.