龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > div+css/html >

点击单选框就直接激活链接的实现代码

时间:2012-12-29 08:41来源:未知 作者:admin 点击:
分享到:
html head !--第一步:把如下代码加入到“head”区域中-- script function go(HrefName) { window.location.href = HrefName; } /script /head body !--第二步:把如下代码加入到“body”区域中-- form name="form" div ali
<html>
<head>
<!--第一步:把如下代码加入到“head”区域中-->
<script>
function go(HrefName) {
window.location.href = HrefName;
}
</script>
</head>
<body>
<!--第二步:把如下代码加入到“body”区域中-->
<form name="form">
<div align="center">
<input type="radio" name="HrefName" onClick="go('http://www.webjx.com/htmldata/sort/3.html');">
选中即激发了超链接<br>
<input type="radio" name="HrefName" onClick="go('http://www.webjx.com/htmldata/sort/1.html');">
选中即激发了超链接<br>
<input type="radio" name="HrefName" onClick="go('http://www.webjx.com/htmldata/sort/5.html');">
选中即激发了超链接<br>
</div>
</form>
</body>
</html>
    [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]

精彩图集

赞助商链接