必需载入jquery
  js部分
  jQuery(document).ready(function() { $("#buyc").click(function(){         var pn=$("#pn").attr("value");          $(this).attr("href",$(this).attr("href")+"&enews=AddBuycar&pn="+pn); }); });
 
  html代码增加减少部分
 
  <img src="58.jpg" onclick='if (document.getElementById("pn").value>1){document.getElementById("pn").value--;}' /><input type="text" id="pn" name="pn" maxlength="5" value="1"   /><img src="62.jpg" onclick='document.getElementById("pn").value++;' />
 
 
  加入购物车部分
  <a href="/e/ShopSys/doaction.php?classid=[!--classid--]&id=[!--id--]" id="buyc">加入购物车</a>
 
  附加减图片
  
  
								 |