First of all say how the user clicks on input with the search button to pop the keyboard, in fact, very simple, plus type= "search" can be.
Example:
<input id= "keyword" placeholder= "input keyword search" type= "Searching"/>
Effect Chart:
Then how to get the Search button click event, the code is as follows:
$ ("#keyword"). On (' KeyPress ', function (e) {
var keycode = E.keycode;
var Searchname = $ (this). Val ();
if (keycode== ') {
e.preventdefault ();
Request Search Interface
}
});
After the comment plus the event you want to add, it's OK. Can alert ("test"); try it!
Explain, the computer side is also available, at this time will not eject the keyboard, the physical keyboard of the role of the ENTER key equivalent to the search button.
This very simple but very practical tips for everyone, to enhance the user experience just, like please reprint ~