<script>
function globelQuery(event) {
if ((event.keyCode == 13) && (event.srcElement == document.getElementById("searchText"))) {
var searchText = $("#searchText").val();
if (searchText != "") {
var url = '@Url.Action("search","home")' + "?searchText=" + searchText;
window.location.href = url;
}
}
}
</script>
<input type="text" id="searchText" οnkeydοwn="globelQuery(event);"/>
<input type="button" id="searchBtn" />
回车触发单击按钮
最新推荐文章于 2024-01-31 17:48:47 发布