Javascript examples for DOM HTML Element:Textarea
hide a <div> and show only when a <textarea> has focus
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <div id="divID"> Menu /* w ww . j a va 2 s . c om*/ </div> <textarea onfocus="hideDiv()" onblur="showDiv()"> ABC </textarea> <script type="text/javascript"> function hideDiv(){ document.getElementById("divID").style.display = 'none'; } function showDiv(){ document.getElementById("divID").style.display = 'block'; } </script> </body> </html>