Javascript on lost focus event for tab out
<p>I have a javascript function like this:</p>

<pre><code>ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "watermark", "function WaterMark(txtWaterMark, event, text) {if(event.type == 'keyup') {var charCode; if (event.charCode) { charCode = event.charCode;} else { charCode = event.keyCode; } if(charCode == 9 &amp;&amp; txtWaterMark.value.length == 0) txtWaterMark.value = 'Pakistan';}  if (txtWaterMark.value.length &gt; 0 &amp;&amp; event.type == 'mouseover') { txtWaterMark.style.color = '#c6c1c1'; } if (txtWaterMark.value.length &gt; 0 &amp;&amp; event.type == 'mouseout') { txtWaterMark.style.color = 'gray';} if (txtWaterMark.value.length == 0 &amp;&amp; event.type == 'mouseout') {txtWaterMark.value = text; }  if (event.type == 'focus') {txtWaterMark.style.color = 'gray'; if (txtWaterMark.value == text) { txtWaterMark.value = ''; } }}", true);
</code></pre>

<p>and I am calling it like this:</p>

<pre><code>  &lt;asp:TextBox ID="txtFirstName" runat="server" Width="110px" Text="First Name."
                ForeColor="Gray" onmouseover="WaterMark(this, event,'First Name.');" onmouseout="WaterMark(this, event,'First Name.');"
                onfocus="WaterMark(this, event,'First Name.');" onkeyup="WaterMark(this, event,'First Name.');" ToolTip="First Name."
                ValidationGroup="CheckoutConfirm"&gt;&lt;/asp:TextBox&gt;
</code></pre>

<p>I am using on keyup event so that if user press tab key to move between textboxes, then a text is added to the text box, but on keyup is fired when i focus is inside the textbox after pressing tab. I want some event like 'on lost focus' I tried on blur but no benefit.</p>
