Update an item and trigger change (whether disabled or not)
In multiple parts of my code I need to update the value of an item, and in some cases it may have been disabled for user input; but in all cases I want the "change" event to fire, regardless.
I need a function that will take a jQuery expression, and a new value to set any corresponding item(s) to the new value; and then fire the "change" event on them. If the item was disabled, it should remain disabled.
jQuery 1.7.1
Answers 1
I'd suggest you to make the
<input>
readonly instead of disabled.Demo