knockout.js - Javascript test for blur event -
i'm working knockout. i'm trying test enter key press or blur event.
html:
<input class="percent-text" data-bind="numeric: percent, value: percent, event: { keypress: $root.percentupdate, blur: $root.percentupdate }" type="number" min="1" max="100" oninput="maxlength(this)" maxlength="3" />
knockout model:
self.percentupdate = function (data, event) { if (event.keycode === 13 || test blur here) { ....
not sure how test blur event. thanks
not familiar knockout, assume regular javascript work:
self.percentupdate = function (data, event) { if (event.keycode === 13 || event.type==='blur') {