Many times in the mobile Web page, need to use the search function, but there is not much space on the page to place a search button like the PC side, this time need to borrow the phone input method comes with the search button to achieve click Search
Although not a big function, but it is very practical, the effect of the implementation of two points
1. Click the input element and the lower right corner of the keyboard appears as "Search"
2. When you click Search, you can start the JS event on the departure page
<!doctype html>
<meta charset= "UTF-8" >
<title>Document</title>
<meta name= "viewport" content= "Width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" >
<script src= "//cdn.bootcss.com/jquery/1.11.0/jquery.min.js" ></script>
<body>
<form id= "MyForm" action= "" onsubmit= "return false;" >
<input id= "myinput" type= "Search" >
</form>
</body>
<script>
Both can be used, one is on the form plus ID one is the INPUT element plus ID
Adding a FORM element to an Apple phone is necessary, otherwise it can only function but the keyboard text cannot be turned into a search word.
$ (' #myform '). Bind (' Search ', function () {
Coding
Alert (1);
// });
$ (' #myinput '). Bind (' Search ', function () {
Coding
Alert (1);
});
</script>