html:
<a href="javascript:void(0);" id="jian">减</a>
<input type="text" class="num-text" value="1" />
<a href="javascript:void(0);" id="jia">加</a>
js:
//商品数量为1减号变色
if($(".num-text").val()==1){
$("#jian").css("color","red");
}else{
$("#jian").css("color","#999");
}
$("#jian").click(function(){
var lsoek=$(".num-text");
if(lsoek.val()>1){
var lskoe=parseInt(lsoek.val());
var eiow=parseInt($("#sp_num").text());
lsoek.val(lskoe-1);
$("#sp_num").text(eiow-1);