亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

onclick單選按鈕將數字添加到總數但無限添加

onclick單選按鈕將數字添加到總數但無限添加

PHP
30秒到達戰場 2021-08-27 09:18:34
我有這個 jquery 代碼var theTotal = jQuery('.woocommerce-Price-amount.amount').text();var price = theTotal.replace("$", "");jQuery('input[name="dimming"]').bind('click', function (e) {    var haller = jQuery(this).val();    if (haller == '1-10V dimmer') {        price = Number(price) + 150;    } else {        price = Number(price) - 150;    }    jQuery('.woocommerce-Price-amount.amount').text(price); });我有這個單選按鈕,所以當我選擇單選按鈕“layer2”時,它應該在原始數量上增加 150[] layer1 (+ $0)[] layer2 (+ $150)結果<span class="woocommerce-Price-amount amount">746</span>但是當我多次單擊 layer2 時,它總是相加,無論我選擇該按鈕多少次,它都應該始終是原始價格 + 150,請幫忙這是我的小提琴https://jsfiddle.net/kxvc6t2L/
查看完整描述

2 回答

  • 2 回答
  • 0 關注
  • 172 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號