Jquery点击input 文本,文字消失,账号密码文本消失的处理方法,看一个div在上面遮住文本

$(function() { $("#textadd").focus(function() { if($(this).val()=="半半注册邮箱") { $(this).val("") } }).blur(function() { if($(this).val()=="") { $(this).val("半半注册邮箱") } }) $("#textsec").focus(function() { if($(this).val()=="") { $(".sec_P").hide(); } }).blur(function() { if($(this).val()=="") { $(".sec_P").show(); } }) })
原文地址:https://www.cnblogs.com/zmeieasyjob/p/4275039.html