欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

js實(shí)現(xiàn)選中復(fù)選框文字變色的方法

 更新時(shí)間:2015年08月14日 09:33:44   作者:企鵝  
這篇文章主要介紹了js實(shí)現(xiàn)選中復(fù)選框文字變色的方法,涉及javascript鼠標(biāo)事件及頁面元素的相關(guān)操作技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下

本文實(shí)例講述了js實(shí)現(xiàn)選中復(fù)選框文字變色的方法。分享給大家供大家參考。具體如下:

這里實(shí)現(xiàn)選中復(fù)選框時(shí),文字加上一個(gè)背景色,變通一下,還是很有用的。

運(yùn)行效果如下圖所示:

在線演示地址如下:

http://demo.jb51.net/js/2015/js-checkbox-cha-font-color-codes/

具體代碼如下:

<html>
<head>
<title>選中復(fù)選框文字變色</title>
<style>
.checkbox {
 background-Color:e-xpression(this.checked?'yellow':'buttonface');
}
</style>
</head>
<script>
function chaCloor(field){
var pig = field.checked;
pig?field.nextSibling.style.backgroundColor="skyblue":field.nextSibling.style.backgroundColor="white";
}
</script>
<body>
<table height=48 width=136>
<tr>
 <td><input type="checkbox" onClick="chaCloor(this)"><span>網(wǎng)頁特效</span></td>
</tr>
<tr>
<td><input type="checkbox" onClick="chaCloor(this)"><span>源碼下載</span></td>
</tr>
<tr>
<td><input type="checkbox" onClick="chaCloor(this)"><span>編程軟件</span></td>
</tr>
</table>
</body>
</html>

希望本文所述對(duì)大家的javascript程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論