easyui jquery 文本框 默认是默认值 在获取焦点时 自动清空 我怎么可以保留默认值
$(function(){
$(".table_content").click(function(){
$("textarea").eq(0).val($(this).attr("title"));
$("textarea").eq(1).val($(this).attr("nei"));
var title=$(this).attr("title");
var nei=$(this).attr("nei");
$('#dlg').dialog('open');
$("textarea").eq(0).focus(function(){
if(this.value==title)
{
this.value=title;
}
});
$("textarea").eq(1).focus(function(){
if(this.value==nei)
{
this.value=nei;
}
});
$("#hidden").val($(this).children().eq(1).html());
});
})
</script>
此为打开效果 点击默认值会被清空 我需要保留默认值 对其进行修改 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励30(财富值+成长值)
推荐于2016-01-11 · 知道合伙人数码行家
你这个默认值是怎么加载出来的?把你的html代码贴出来,是不是用placeholder了?
<form id="login">
<ul>
<li>
<input id="email" name="email" placeholder="Your Email" title="Your Email" type="email" required />
<label for="email">Your Email</label>
</li>
<li>
<input id="password" name="password" placeholder="Your Password" title="Your Password" type="password" required />
<label for="password">Your Password</label>
</li>
<li>
<input id="submit" name="submit" type="submit" value="Login">
</li>
</ul>
</form>
label{line-height: 40px; position: absolute; right: 120px; top: 0; bottom: 0;
-moz-transition: 0.3s right ease;
-ms-transition: 0.3s right ease;
-o-transition: 0.3s right ease;
-webkit-transition: 0.3s right ease;
transition: 0.3s right ease;
z-index: 0}
input{color: transparent; font-size: 12px; height: 35px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px;
-moz-transition: 0.3s all ease;
-ms-transition: 0.3s all ease;
-o-transition: 0.3s all ease;
-webkit-transition: 0.3s all ease;
transition: 0.3s all ease;}
input[type="email"], input[type="password"]{border: 1px solid #ccc; height: 35px; padding: 0 10px; width: 240px; position: relative;
-moz-box-shadow: inset 0 0 10px rgba(0,0,0,.06);
-webkit-box-shadow: inset 0 0 10px rgba(0,0,0,.06);
box-shadow: inset 0 0 10px rgba(0,0,0,.06);
z-index: 2;}
input[type="email"]{color: rgba(47,130,194,.8);}
input[type="password"]{color: rgba(237,28,112,.8);}
/* Placeholder */
input[type="email"]:-moz-placeholder{color: rgba(47,130,194,.6);}
input[type="email"]:-ms-input-placeholder{color: rgba(47,130,194,.6);}
input[type="email"]::-webkit-input-placeholder{color: rgba(47,130,194,.6);}
input[type="password"]:-moz-placeholder{color: rgba(237,28,112,.6);}
input[type="password"]:-ms-input-placeholder{color: rgba(237,28,112,.6);}
input[type="password"]::-webkit-input-placeholder{color: rgba(237,28,112,.6);}
/* Label */
input[type="email"] + label{color: rgb(47,130,194);}
input[type="password"] + label{color: rgb(237,28,112);}
input:focus + label{right: 10px;}
input[type="email"]:focus, input[type="password"]:focus{background-color: rgba(255,255,255,.8);}
/* Submit */
input[type="submit"]{
background-color: #333;
background: -moz-linear-gradient(bottom, #333, #444);
background: -ms-linear-gradient(bottom, #333, #444);
background: -o-linear-gradient(bottom, #333, #444);
background: -webkit-linear-gradient(bottom, #333, #444);
background: linear-gradient(bottom, #333, #444);
border: 1px solid #222; color: #fff; cursor: pointer; height: 35px; width: 110px;
}
input[type="submit"]:hover{color: #ff6937;text-shadow: 0 0 1px rgba(255,255,255,.2);}
.table_content
是表格每行的class 绑定的点击方法 弹出层
嗯,哪里有疑问?