bootstrap 4 - buttons
https://v4-alpha.getbootstrap.com/components/buttons/
HTML
<div id="radioGroup" class="btn-group" data-toggle="buttons">
<label class="btn btn-primary active">
<input type="radio" name="options" id="option1" autocomplete="off" checked value="Radio1" /> Radio 1 (preselected)
</label>
<label class="btn btn-primary">
<input type="radio" name="options" id="option2" autocomplete="off" value="Radio2" /> Radio 2
</label>
<label class="btn btn-primary">
<input type="radio" name="options" id="option3" autocomplete="off" value="Radio3" /> Radio 3
</label>
</div>
javascript
var radioGroup = $('#radioGroup input:radio:checked').val();
alert(radioGroup);
$(document).on('click','#radioGroup', function(){
var checkedRadio = $('#radioGroup input:radio:checked').val();
alert(checkedRadio);
});
demo link : https://jsfiddle.net/86w6c0y2/4/
'js > jQuery' 카테고리의 다른 글
kendo ui jquery grid 링크가 걸린 컬럼에만 cursor: pointer 스타일을 주고 싶을때 (0) | 2020.11.17 |
---|---|
[jquery][twbsPagination] 페이징 기본형 (0) | 2018.06.15 |
[javascript] 모달 사용시 콜백 예제 (0) | 2018.01.25 |
[jquery] div 스크롤 감지(바닥, 끝) (0) | 2018.01.24 |
[javascript] guid 만들기 (0) | 2017.12.07 |