OnFocus event. Sometimes you want to clear text when user click in TextBox.
Definition:
The onfocus event occurs when an object gets focus.
Code:
Following the javascript.
<script type="text/javascript">
function Focus(a)
{
if(a.value = = a.defaultValue)
a.value = "";
}
</script>
HTML Code:
<input type="text" value="Email ID" onfocus="Focus(this)" id="txtEmail" name="txtEmail" />
Definition:
The onfocus event occurs when an object gets focus.
Code:
Following the javascript.
<script type="text/javascript">
function Focus(a)
{
if(a.value = = a.defaultValue)
a.value = "";
}
</script>
HTML Code:
<input type="text" value="Email ID" onfocus="Focus(this)" id="txtEmail" name="txtEmail" />
No comments:
Post a Comment