Javascript examples for DOM HTML Element:Div
Changing A Text Field Based On div mouse event
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> function change(x) {/*from ww w. jav a 2s . co m*/ document.getElementById("mybox").value = "Changed by " + x; } </script> </head> <body> <input type="text" value="" id="mybox" size="100"> <br> <input type="button" value="Button Click" onClick="change('button')"> <br> <div onmouseover="change('OnMouseOver')" onmouseout="change('OnMouseOut')"> Some div </div> </body> </html>