KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
First, the fiddle . $('#enableButtonB').click(function (e) { if($(e.target).is(':checked')) { $('#myButtonB').removeProp('disabled'); alert('Enable Button B'); } else { $('#myButtonB').prop('disabled', true); alert('Disable Button B'); } }); I'm trying to use jQuery's .prop() and removeProp() methods to enable and disable a button based on some criteria. It seems to work fine until removeProp() is called on the element. After that any subsequent calls to prop() fail to disable to button. What's the proper way to enable and disable an element repeatedly?
Tags (comma-separated)
Save Edits
Cancel