which a...">

How to call iOS search button using javascript / Jquery?

I have searcharea where i used

<form><input name="search"/></form>


which allows and shows the search button on the iOS mobile keyboard.

Now my question is, how can I find this search button in the code so that I can add onclick = "(callFunction)", for example, how could I do it if I created the button myself. Any help or input is greatly appreciated, thanks!


source to share

1 answer

I think you are using and type="search"

, so you can attach an event handler to the event search

, for example:

$('input[type=search]').on('search', function () {
    // search logic



<input type="search" name="search" onsearch="OnSearch(this)"/>



Occurs when the user presses the ENTER key or clicks the Erase Search button text '(x) in the input field: search field.

Link: http://help.dottoro.com/ljdvxmhr.php

Demo: http://jsfiddle.net/rb684u8o/



All Articles