JavaScript表单与数组的实用指南
1. 使用下拉菜单作为导航工具
下拉菜单可作为导航工具,如无国界医生组织使用的那种。以下是创建导航下拉菜单的示例代码:
<html>
<head>
<title>A Pull-Down Menu for Navigation</title>
<script type = "text/javascript">
<!-- hide me from older browsers
function visitSite(the_site)
{
window.location = the_site;
}
// show me -->
</script>
</head>
<body>
<h1>Use the pull-down menu to choose where you want to go</h1>
<form name = "the_form">
<select name = "the_select" onChange = "visitSite(this.value);">
<option value = "http://www.nostarch.com">No Starch Press</option>
<option value = "http://www.nytimes.com">The New York Times</option>
<option value = "http://w
超级会员免费看
订阅专栏 解锁全文
910

被折叠的 条评论
为什么被折叠?



