87,996
社区成员




input{
_background-color: expression((function(elem){
if(elem.type === "text"){
return "#FFFFCC";
}else if(elem.type === "button"){
return "#EEEEEE";
}
})(this));
}
input[type=text]{
background-color: #FFFFCC;
}
input[type=button]{
background-color: #EEEEEE;
}
input[type=button]{
}
input[type=text]{
}
CSS轻松就搞定了,哪需要用到什么jQuery。。<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js"></script>
<input type="text"/>
<input type="button"/>
<script language="javascript" type="text/javascript">
$(function(){
$("input[type=text]").css("border-color","red");
$("input[type=button]").css("border-color","blue");
})
</script>