laksh_khamesra
New Member
I want a div layer to appear when focused and disappear when blurred.
So I called 2 functions through events in the input.
The input code is like this:--
And the javascript code is like this:--
And the div layer's code is like this:--
So I called 2 functions through events in the input.
The input code is like this:--
HTML:
<input type="text" name="username" id="username" onfocus="show_div('apDiv1')" onblur="hide_div('apDiv1')" />
And the javascript code is like this:--
HTML:
<script language="javascript">
function show_div(div_id)
{
document.all.div_id.style.visibility = "visible";
}
function hide_div(div_id)
{
document.all.div_id.style.visibility = "hidden";
}
</script>
And the div layer's code is like this:--
HTML:
<div id="apDiv1">Username can contain only numbers and letters.</div>