1 var fbp = false; 2 $("#groupsjname").live("focus",function() { 3 $(this).css("border", "1px solid #4489d1"); 4 fbp = true; 5 if ($(this).val() == "" || $(this).val() == "输入商家名称") {$(this).val(""); } 6 }).blur(function(){ 7 if ($(this).val() == "" || $(this).val() == "输入商家名称") {$(this).val('输入商家名称');} 8 fbp = false; 9 if ($(this).val().replace(/\s+/g, "").length > 0) { 10 $(this).css("border", "1px solid #4489d1"); 11 } 12 else { 13 $(this).css("border", "1px solid #cecece"); 14 } 15 }).hover(function() { 16 $(this).css("border", "1px solid #4489d1"); 17 }, function() { 18 if (fbp) { 19 $(this).css("border", "1px solid #4489d1"); 20 } 21 else { 22 $(this).css("border", "1px solid #cecece"); 23 } 24 });
相关文章:
- 简单的文本框输入自动提示 2021-11-13
- WebView输入框提示 2021-10-19
- html5 input placeholder 占位符 输入框提示文本 2021-12-15
- 总结4:input文本输入框自动提示 2021-10-06
- 文本框输入内容自动提示效果 2022-12-23