使用引導程序的決定,我有一組按鈕:使基於所檢查按鈕
<div id="first" class="panel panel-primary panel-width">
<div class="panel-heading">Yes/No Question</div>
<div id="answer" class="panel-body">
<div class="btn-group-sm" role="group" data-toggle="buttons-checkbox" aria-label="...">
<button type="button" name="CusYes" class="btn btn-default">Yes</button>
<button type="button" class="btn btn-default">No</button>
</div>
</div>
,我要檢查用戶是否檢查yes或no。這是我如何檢查一個js文件:
$(document).ready(function() {
$("#Submit").click(function() {
var CusYes = $("input:button[name=CusYes]:checked").val();
if(CusYes ==== "Yes") { alert ("it works!");}
});
});
它用於改變bootstrap之前工作,但現在它不工作。
添加代碼提交:
<button id="Submit" type="button" class="btn btn-success">
<span class="glyphicon glyphicon-thumbs-up" aria-hidden="true"></span> Submit !
</button>
哪裏#submit? – Anshul
添加代碼提交 –
它在服務器上嗎?你能提供鏈接嗎?它會更好地調試 – divy3993