Thursday, November 21, 2013

html input type text removing js code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
   <meta http-equiv="content-type" content="text/html;charset=utf-8" />
   <title>Template</title>
   <script type="text/javascript">
      function focusMe(sender) {
         if (sender.value == sender.defaultValue) {
            sender.value = "";
            sender.style.color = "#000000";
         }
      }
      function blurMe(sender) {
         if (sender.value == "") {
            sender.value = sender.defaultValue;
            sender.style.color = "#C0C0C0";
         }
      }
   </script>
</head>
<body>
   <p><input type="text" style="color: #C0C0C0;" value="E-mail here" onfocus="focusMe(this);" onblur="blurMe(this);" /></p>
</body>
</html>

No comments: