web之家  

 

1、

<span class="big"  style="text-decoration:line-through;">原价:¥{zlcms:articleField name="market_price"/}</span>

2、小手图标

<input id="btn" type="button" value="立即购买" onclick="addCart(0,'');" style="cursor:pointer;" class="gm" />  

3、验证所预定数量是否大于库存或者计算总额,用onblur,onblur 事件会在对象失去焦点时发生。

<input type="text" onkeyup="this.value=this.value.replace(/[^\d]/g,''); if(this.value=='' || this.value=='0'){this.value='1';}" onblur="total('11')"  >

4、input 输入框一定为数字,输入非数字替换掉,初始值为1

<input type="text" onkeyup="this.value=this.value.replace(/[^\d]/g,''); if(this.value=='' || this.value=='0'){this.value='1';}" onblur="total('11')"  >

  

 

posted on 2017-08-07 13:16  路修远而求索  阅读(244)  评论(0编辑  收藏  举报