JQuery responds to mouse events and hides and displays input defaults

  • 2020-03-30 03:46:49
  • OfStack

Share an example of how jQuery hides and displays input defaults.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>jQuery  Hide and show  input  The default value </title> 
<script language="javascript" src="jquery-1.7.1.min.js"></script> 
<p><input type="text" value=" Please enter your email address " id="email" id="email" /></p> 
<p><input type="button" value=" submit " /></p> 
<script type="text/javascript"> 
var email_txt = $(this).val(); 
if (email_txt == this.defaultValue) { 
var email_txt = $(this).val(); 
if (email_txt == "") { 

Related articles: