仍然在學習jQuery,並將感謝任何幫助。jQuery開關按鈕開/關應設置不同的數據狀態和Onclick功能
我目前使用這個jQuery Switchbutton https://github.com/olance/jQuery-switchButton 它使用複選框作爲輸入類型,並創建帶標籤的span標籤。 我怎麼說我想on_label有數據狀態 =「接受」,並off_label 數據狀態 =「拒絕」?
HTML: <input type="checkbox" id="accept-offer"/>
JS: $("input#accept-offer").switchButton({ on_label: "Accept", off_label: "Ignore"
});
謝謝!
你也許可以爲此創建的jsfiddle,它會幫助我們來幫助你更快 – dcodesmith