#9485 closed bug (worksforme)
Using the prop method to set disabled fails in Chrome
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | attributes | Version: | 1.6.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
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 (8)
comment:1 follow-up: 7 Changed 12 years ago by
Component: | unfiled → attributes |
---|---|
Priority: | undecided → low |
Resolution: | → worksforme |
Status: | new → closed |
comment:3 Changed 12 years ago by
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 12 years ago by
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 Changed 10 years ago by
Replying to timmywil:
Works fine for me: http://jsfiddle.net/timmywil/4hjWu/
It does not work (in Chrome) after using removeProp():
comment:8 Changed 10 years ago by
@anonymous: see the above note from the removeProp
docs. Do not use removeProp
for that.
Works fine for me: http://jsfiddle.net/timmywil/4hjWu/