1
按钮点击不发射。感谢任何帮助。 这是jsfiddle链接。 https://jsfiddle.net/264aosnk/。 代码是这样的:淘汰赛 - 按钮点击不起作用
<body>
<div id="topNavConstant" >
<input placeholder="Enter search criteria" id="searchbox" data- bind="value:criteria, valueUpdate:'afterkeydown'" type="search" autocomplete='off'/>
<input type="button" value="Click" data-bind="click:searchresults"/>
</div>
//脚本
function myModel(){
var self = this;
self.criteria = ko.observable("");
self.searchresults = ko.observable(function(){
alert('Feature yet to come...');
});
}
ko.applyBindings(new myModel());
我没有看到单击按钮时警报消息。
非常感谢你。 – MVS