代码如下: 1 jQuery(".member_id").focus(function() { 2 jQuery(this).val(); 3 }).blur(function() { 4 5 if(jQuery(this ...
代码如下:
1 jQuery(".member_id").focus(function() { 2 jQuery(this).val(''); 3 }).blur(function() { 4 5 if(jQuery(this).val() == "") { jQuery(this).val("账号"); } 6 }); 7 8 jQuery(".member_passwd").focus(function() { 9 jQuery(this).val('');10 document.getElementById("member_passwd").type="password";11 //jQuery(this).attr('type','password');12 }).blur(function() { 13 14 if(jQuery(this).val() == "") { jQuery(this).val("密码"); document.getElementById("member_passwd").type="text"; }15 });16 17 18 });
海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com
原标题:JQuery中如何动态修改input的type属性
关键词:jquery
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。