回车搜索 手机键盘出现搜索字样

<script type="text/javascript">
function doSubmit() {
alert("XXXXXXXXX");
return false;              返回false  就不会跳页了
}


</script>

<form onsubmit="return doSubmit();" method="post" action="">
<input type="search" />

<!-- <input type="text" style="display:none" value="此处的input删掉然后回车按钮就会触发提交" />-->

</form>

原文地址:https://www.cnblogs.com/nns4/p/7489127.html