How to call a function using knockout.js when enter key is pressed.. here is my code below.
ko.bindingHandlers.enterkey = { init: function (element, valueAcc
And this worked for me, thanks to @DaafVader.
in view:
in javascript:
$("#myInput").keyup(function (event) { if (event.keyCode == 13) { search(); } });
To put keyup event in your jquery event instead of knockout event reduced the complexity of the knockout viewmodel.