function ck_click(obj) { var ck_20 = document.getElementById("ck_20"); var ck_25 = document.getElementById("ck_25"); var ck_30 = document.getElementById("ck_30"); ck_20.checked = false; ck_25.checked = false; ck_30.checked = false; obj.checked = true; } <input type="checkbox" id="ck_20" value="20" name="ck" onclick="ck_click(this)"> <input type="checkbox" id="ck_25" value="25" name="ck" onclick="ck_click(this)"> <input type="checkbox" id="ck_30" value="30" name="ck" onclick="ck_click(this)">
时间: 2024-10-12 12:32:48