源代碼
點擊運行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>教程</title> </head> <body> <form action=""> <input type="radio" name="sex" value="male">Male<br> <input type="radio" name="sex" value="female">Female </form> <p><b>注意:</b>當用戶點擊一個單選按鈕時,它就會被選中,其他同名的單選按鈕就不會被選中。</p> </body> </html>
運行結果