Search This Blog

Clear Textbox when Onclick HTML Javascript code

<html><head><title>password</title>
<script type = "text/javascript">
onload = function()
{
 var pStyle = document.getElementsByName('passwd')[0].style
 pStyle.backgroundColor="transparent";
 pStyle.backgroundImage="url(pass.gif)";
 pStyle.backgroundRepeat="no-repeat";
}
</script>
</head>
<body>
<form>
 <input name="passwd" type="password"
 onfocus="this.style.backgroundImage='';"/>
</form>

</body></html>