`

javascript控制数字下划线样式(这只是一个例子)

阅读更多
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Untitled Document</title>
	</head>
	<body>
		<a id="choose1" name="choose" style="cursor:hand;color:black;border-bottom:1px solid black;" onclick="choosePlay('choose1')">1</a>
		<a id="choose2" name="choose" style="cursor:hand;color:black;border-bottom:1px solid black;" onclick="choosePlay('choose2')">2</a>
		
		<script type="text/javascript">
			function choosePlay(id){
				var chooseSS=document.getElementsByName("choose");
				for(var i=0;i<chooseSS.length;i++){
					chooseSS[i].style.cssText="cursor:hand;color:black;border-bottom:1px solid black;";
				}
				var choose=document.getElementById(id);
				choose.style.cssText="cursor:hand;color:blue;font-weight:bolder;";
			}
			
		</script>
	</body>
</html>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics