Code
Execute
<!DOCTYPE html> <html> <head> <title>html tutorial - html5 - html code - html form - In 30Sec by Microsoft Award MVP - | wikitechy onsearch attribute </title> </head> <body> <h2>Wikitechy Search bar</h2> <p>Type something in the Searchbar and press "ENTER".</p> <input type="search" id="tutorials" onsearch="onSearch(this.value)"> <script> function onSearch(val) { alert("You are searching for : " + val); } </script> </body> </html>
Result