Add character entity from numerical identifier to input value - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Form Event

Description

Add character entity from numerical identifier to input value

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
function check(ds) {//from  ww  w.  j a  v  a  2s  .c  o  m
    if(ds.value==''){
        ds.value='enter name \u002D\u003E';
    }
}

      </script> 
   </head> 
   <body> 
      <input value="enter name ->" onfocus="if(this.value=='enter name ->'){this.value=''};" onblur="check(this);">  
   </body>
</html>

Related Tutorials