CSS Portal
Run
Search
« 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>
If this site has been useful, we’d love your support! Running this site takes time and resources, and every small contribution helps us keep creating valuable content. Consider buying us a coffee to keep things going strong!
☕ Buy a Coffee