본문 바로가기
Programming/Javascript

Radio button in group

by peter paak 2019. 12. 3.
728x90

just to make one of the radio button checked when the others are unchecked

<fieldset id="group1">
    <input class="form-check-input" name="group1" type="radio" value="EMAIL">이메일
    <input class="form-check-input" name="group1" type="radio" value="GOOGLE">구글
</fieldset>

make user you should put the group of radio buttons in the same group id of fieldset (in this case I gave them group1), also give the same name of each button which is fieldset id

728x90