Ticket #9485 (closed bug: worksforme)
Using the prop method to set disabled fails in Chrome
| Reported by: | cscott@… | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 1.next |
| Component: | attributes | Version: | 1.6.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
I have a site where I select multiple objects and set the prop('disable', true). This works fine in FF3.6 but fails in Chrome 11.
Here's my sample code:
$('#id').find('button').prop('disabled', true); this fails $('#id').find('button').attr('disabled', true); this works
<div id='id'>
<p>data</p> <div>
<button>Button1</button> <button>Button2</button>
</div>
</div>
Change History
comment:1 follow-up: ↓ 7 Changed 2 years ago by timmywil
- Priority changed from undecided to low
- Resolution set to worksforme
- Status changed from new to closed
- Component changed from unfiled to attributes
comment:3 Changed 2 years ago by cscott@…
I guess I didn't explain enough. I have a tool that toggles the state of the property, so it sets it and then removes it. It will not work after removing the property. Please see: http://jsfiddle.net/Ahx3D/
comment:5 Changed 2 years ago by timmywil
From the docs:
"Note: Do not use [removeProp] to remove native properties such as checked, disabled, or selected. This will remove the property completely and, once removed, cannot be added again to element. Use .prop() to set these properties to false instead."
comment:7 in reply to: ↑ 1 Changed 5 months ago by anonymous
Replying to timmywil:
Works fine for me: http://jsfiddle.net/timmywil/4hjWu/
It does not work (in Chrome) after using removeProp():
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Works fine for me: http://jsfiddle.net/timmywil/4hjWu/