Created
July 3, 2015 12:07
-
-
Save MrSwed/c56dea524b5185520b78 to your computer and use it in GitHub Desktop.
Trigger change on changed prop or attr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // it getted from https://forum.jquery.com/topic/should-chk-prop-checked-true-trigger-change-event | |
| $.attrHooks.checked = { | |
| set: function(elem, value, name) { | |
| var ret = (elem[ name ] = value); | |
| $(elem).trigger("change"); | |
| return ret; | |
| } | |
| }; | |
| $.propHooks.checked = { | |
| set: function(elem, value, name) { | |
| var ret = (elem[ name ] = value); | |
| $(elem).trigger("change"); | |
| return ret; | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment