I'm newer in JavaScript.So maybe my question will seem naive.
My JavaScript Code:
<script type = "text/javascript">
var defaultText = "Enter your text here";
function WaterMark(txt, evt)
{
if(txt.value.length == 0 && evt.type == "blur")
{
txt.style.color = "gray";
txt.value = defaultText;
}
if(txt.value == defaultText && evt.type == "focus")
{
txt.style.color = "black";
txt.value="";
}
}
ASP declaration:
<asp:TextBox ID="TextBox1" runat="server" Text = "Enter your text here
ForeColor = "Gray"
onblur = "WaterMark(this, event);"
onfocus = "WaterMark(this, event);">
My quetstion is about parameters of this two events:
onblur = "WaterMark(this, event);"
onfocus = "WaterMark(this, event);"
If i understood correctly word this means the current control.
And what is meaning of the second parameter, event ?
Thank you in advance!