Simple jQuery on input fields to remove text upon user focus
$("#email").focus(function() {
if ($(this).val() == $(this).attr('rel'))
$(this).val('');
});
$("#email").blur(function() {
if ($(this).val() == '')
$(this).val($(this).attr("rel"));
});
<input type='text' id='email' value='Enter your Email' rel='Enter your Email' />
The content will contain "Enter your Email". But when the user enters the field, it will clear out the value... and vise versa.
Comments are only visible to Forrst members. Log in or Request an invite.
