中文字幕一区二区人妻电影,亚洲av无码一区二区乱子伦as ,亚洲精品无码永久在线观看,亚洲成aⅴ人片久青草影院按摩,亚洲黑人巨大videos

Radio checked 屬性

Radio 對(duì)象參考手冊(cè) Radio 對(duì)象

定義和用法

checked 屬性可設(shè)置或返回某個(gè)單選按鈕是否被選中。

語法

設(shè)置 checked 屬性:

radioObject.checked=true|false

返回 checked 屬性:

radioObject.checked

瀏覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主要瀏覽器都支持 checked 屬性


實(shí)例

實(shí)例

下面的例子可對(duì)一個(gè)單選按鈕進(jìn)行選定和不選定:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>小白教程(json.cn)</title>
<script>
function check(){
????document.getElementById("red").checked=true
}
function uncheck(){
????document.getElementById("red").checked=false
}
</script>
</head>
<body>

<form>
你更喜歡哪種顏色?<br>
<input type="radio" name="colors" id="red">紅色<br>
<input type="radio" name="colors" id="blue">藍(lán)色<br>
<input type="radio" name="colors" id="green">綠色
</form>
<button type="button" onclick="check()">選擇 "紅色"</button>
<button type="button" onclick="uncheck()">不選擇 "紅色"</button>
????
</body>
</html>

運(yùn)行代碼 ?

Radio 對(duì)象參考手冊(cè) Radio 對(duì)象其他擴(kuò)展