我想运行search并在<input>
的文本更改后立即显示其结果。
程序更改后如何从<input>
获取值?
<input type="text" name="search" id="search">
<section id="results"></section>
最佳答案
使用ajax将您的价值发布到Golang。
$("input").keyup(function(){
txt=$("input").val();
$.post("url",{suggest:txt},function(result){
$("#results").html(result);
});
});