HTML DOM Input Radio 对象
Input Radio 对象
Input Radio 对象代表带有 type="radio" 的 HTML <input> 元素。
访问 Input Radio 对象
您可以使用 getElementById() 访问 type="radio" 的 <input> 元素:
var x = document.getElementById("myRadio");
提示:您还可以通过搜索表单的 elements 集合 来访问 <input type="radio">。
创建 Input Radio 对象
您可以使用 document.createElement() 方法创建 type="radio" 的 <input> 元素:
var x = document.createElement("INPUT"); x.setAttribute("type", "radio");