<p>单价:3.0</p>
<input id="min" name="" type="button" value="-" />
<input id="text_box" name="" type="text" value="4" />
<input id="add" name="" type="button" value="+" />
<p>小计:<label id="total"></label></p>只写了这一个,给text_box加了一个name,其他的类似$(function () {
            var i = 4;
            $("#total").text(i);
            $("#min:[value=-]").click(function () {
                if (i <= 0) {
                    $("#text_box:[name=text]").val("0");
                    $("#total").text(0);
                } else {
                    $("#text_box:[name=text]").val(i--); 
                    $("#total").text(i+1);
                }
            });
            $("#add:[value=+]").click(function () {
                if (i >= 4) {
                    $("#text_box:[name=text]").val("4");
                    $("#total").text(4);
                } else {
                    $("#text_box:[name=text]").val(i++); 
                    $("#total").text(i-1);
                }
            });
           
        });