javascript - How to get the value of data-* attribute in knockout js -
i'm new knockout js , have came across issue in following lines of code
<input type="checkbox" value="true" data-bind =" attr: { id: 'chk' + action.id, value: id, 'data-id': action.id }, checked: $root.checked" name="checkbox" class="checkbox">
i have added data-id
, wanna value in knockout view model. how can knockout js
var id = action.id();
check http://jsfiddle.net/yaroslavya/xd6ej/1/. clicking different save buttons different action.id value. value connected data-id attribute.
Comments
Post a Comment