Tag Archive | jQuery

Add Watermark to Textbox using jQuery


jQuery(document).ready(function() {
var watermark = "Type the code seen above";
jQuery(".wpcf7-captchar").val(watermark);
jQuery(".wpcf7-captchar").focus(function() {
if (jQuery.trim(jQuery(".wpcf7-captchar").val()) == watermark) {
jQuery(".wpcf7-captchar").val("");
}
});
jQuery(".wpcf7-captchar").blur(function() {
if (jQuery.trim(jQuery(".wpcf7-captchar").val()) == "") {
jQuery(".wpcf7-captchar").val(watermark);
}
});
});

Advertisements