以后地位:首页 > 建站常识 > 列表

用图片取代Radio挑选value值

点击: 次时候:2014/8/8关头词:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>留言板头像挑选代码-无忧图库</title>
<style type="text/css">
.on{margin:5px;border:1px solid #F60;filter:alpha(Opacity=100)}
.off{margin:5px;border:1px solid #CCC;filter:alpha(Opacity=20)}
</style>
</head>

<body>
<script language="javascript">
    function aa(a, b, c) {
        document.form1.img.value = a;
        document.getElementById("touxiang").getElementsByTagName("img")[a - 1].className = "on";
        document.getElementById("touxiang").getElementsByTagName("img")[b - 1].className = "off";
        document.getElementById("touxiang").getElementsByTagName("img")[c - 1].className = "off";
    }
    function Check(x) {
        for (i = 1; i <= 1; i++) document.all.img.value = x
    }
</script>

<div id="touxiang">
<a href="#"><img border="0" src="http://www.5utu.com/images/uppic/12625057550.gif"  name=01 onclick=aa(1,2,3,4);Check(this.name,"") class="off"></a>
<a href="#"><img border="0" src="http://www.5utu.com/images/uppic/12625057551.gif"  name=02 onclick=aa(2,1,3,4);Check(this.name,"") class="off"></a>
<a href="#"><img border="0" src="http://www.5utu.com/images/uppic/12625057552.gif"  name=03 onclick=aa(3,1,2,4);Check(this.name,"") class="off"></a>

<form name="form1">
<input type=text name=img value="01">
</form>
<p>用图片取代Radio框挑选value值,结果还不错,能够用作留言板图象挑选按钮。</p>

</body>
</html>

预定建站
收费供给网站优化
支付关头词