SoFunction
Updated on 2025-03-03

Decorate the watermark with (blur and focus) events for TextBox

 
<script type="text/javascript">
var watermarkText = "Input Name";
function WaterMarkOnBlur(textbox) {
if ( == 0) {
= "gray";
= watermarkText;
}
}
function WaterMartOnfocus(textbox)
{
if ( == watermarkText) {
= "black";
= "";
}
}
</script>