0
我想獲取切換複選框的值。 我的意思是,我想讓我說'1'準備好,'0'準備好就說出來。 我該怎麼做? 這是我的代碼:如何獲取切換複選框的值
<link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet">
<script src="https://gitcdn.github.io/bootstrap-toggle/2.2.2/js/bootstrap-toggle.min.js"></script>
<input type="checkbox" checked data-toggle="toggle" data-on="Ready" data-off="Not Ready" data-onstyle="success" data-offstyle="danger">
我做到了,但遺憾的是沒有結果。 data-onstyle =「未就緒」data-onstyle =「成功」data-offstyle =「危險的」data-on =「準備就緒」data-off =「未準備好」 (); ' –
'document.ready'是jquery風格。你有它包括在你的HTML? –
加'$(this).val()'不會做任何事情。如果你想去jquery樣式,寫'alert($(this).is(「:checked」)); ' –