Javascript examples for DOM HTML Element:Form Event
Handle input mouse in and mouse out event
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <input type="text" id="demoInput" onfocus="demoFocus(this.id)" onfocusout="demoFocusout(this.id)"> <script> function demoFocus(x) {//from w w w.java 2 s.co m document.getElementById(x).style.background = "red"; } function demoFocusout(x) { document.getElementById(x).style.background = "blue"; } </script> </body> </html>