<!--'name' attribute will keep the radio button work as a group. --> <!--group 1--> <input type="radio" name="group1" /> <input type="radio" name="group1" /> <!--group 2--> <input type="radio" name="group2" /> <input type="radio" name="group2" />