Run
Back to
HTML onsearch Event Attribute
<!DOCTYPE html> <html> <head> <title>onsearch event</title> </head> <body> <p>Type something and hit enter:</p> <input type="search" id="testInput" onsearch="testFunction()"> <p id="info"> </p> <script> function testFunction() { var z = document.getElementById("testInput").value; document.getElementById("info").innerHTML = "You are looking for: " + z; } </script> </body> </html>