1
嗨,你能幫我找出如何使用jQuery獲得Bootsramp中所選btn-group的值嗎?如何獲得Bootsramp btn-group的價值使用jQuery
$('.btn-group .btn').on("click",function(){
alert($(this).text())
})
嗨,你能幫我找出如何使用jQuery獲得Bootsramp中所選btn-group的值嗎?如何獲得Bootsramp btn-group的價值使用jQuery
$('.btn-group .btn').on("click",function(){
alert($(this).text())
})
你可以做到這一點代碼這樣的一些jQuery將訣竅:
$(document).ready(function(){
$(".btn-group .btn").on('click', function(){
console.log($(this).text());
});
});
的爲class="btn-group" data-toggle="buttons-radio":
<div class="btn-group" data-toggle="buttons-radio">
<button type="button" class="btn btn-primary">Left</button>
<button type="button" class="btn btn-primary">Middle</button>
<button type="button" class="btn btn-primary">Right</button>
</div>
Thanks NullPointer – Behseini
@Behseini yours welcome –