Identify the attribute change event in KnockoutJS?
问题 Is there any way to Identify the attribute change event in KnockoutJS?? I found solutions in jQuery: firing event on DOM attribute change firing event on DOM attribute change But It would be good If I can do it with KO. Thanks. 回答1: If the attribute change is bound to a property in your view model, then you can simply subscribe to that property to get notified of changes. myViewModel.myProperty.subscribe(function(newValue) { alert("This property changed!!"); }); 来源: https://stackoverflow.com