我不能用 prev 更改 css,我的错误在哪里?小提琴链接
坦克寻找!
CSS:
.i1 {
float: right;
height: 18px;
margin-top: 6px;
}
label {
border-bottom: 1px dotted #CCCCCC;
clear: both;
float: left;
height: 25px;
margin: 5px 0 0;
width: 450px;
line-height: 32px;
}
html:
<label>Titel:<input class="i1" type="text" name="titel" value="" /></label>
<label>Vorname:<input class="i1" type="text" name="vorname" value="" /></label>
<label>Nachname:<input class="i1" type="text" name="nachname" value="" /></label>
查询:
$("input").focus(function () {
$(this).prev("label").css("border-bottom", "1px dotted #63aec4");
});