$("#content").css({"background-color":"red","color":"white"});
2015-02-03
if (p1 > p2) { //如果传入的参数前者大于后者
intResult = parseInt(p1) - parseInt(p2);
}
有bug, p1和p2是按字符串去比较的,应该先转化成int值在去比较?为什么要比较?不能输出负数吗?
intResult = parseInt(p1) - parseInt(p2);
}
有bug, p1和p2是按字符串去比较的,应该先转化成int值在去比较?为什么要比较?不能输出负数吗?
2015-02-03
<script type="text/javascript">
$("#frmTest :image").addClass("bg_red");
$("#frmTest :image").addClass("bg_red");
2015-02-03
<script type="text/javascript">
$("#frmTest :text").addClass("bg_blue");
</script>
$("#frmTest :text").addClass("bg_blue");
</script>
2015-02-03
<script type="text/javascript">
$("li[title='蔬菜']").css("background-color", "green");
</script>
$("li[title='蔬菜']").css("background-color", "green");
</script>
2015-02-03
<script type="text/javascript">
var $strHTML = $("#hidstr:hidden").val();
$("div").html($strHTML);
var $strHTML = $("#hidstr:hidden").val();
$("div").html($strHTML);
2015-02-03
<script type="text/javascript">
$("li:last").css("background-color", "red");
</script>
$("li:last").css("background-color", "red");
</script>
2015-02-03
<script type="text/javascript">
$("p~label").css("border", "solid 1px red");
$("p~label").html("我们都是p先生的粉丝");
</script>
$("p~label").css("border", "solid 1px red");
$("p~label").html("我们都是p先生的粉丝");
</script>
2015-02-03
<script type="text/javascript">
$("p+").css("background-color","red");
<script type="text/javascript">
$("p++").css("background-color","red");嘿嘿
$("p+").css("background-color","red");
<script type="text/javascript">
$("p++").css("background-color","red");嘿嘿
2015-02-03
<script type="text/javascript">
$("div>label").css("border", "solid 5px red");
$("div>label").css("border", "solid 5px red");
2015-02-03
$("div label").css("background-color","blue");
2015-02-03
$(".red ,.green").html("hi,我们的样子很美哦!");
2015-02-03