问题如题 不知表达又没有问题 反正就在网页制作中实现 select选项选定后submit提交 超链接到相对应的页面
解决方案 »
- google chrome打印的问题
- 手头有个貌似被称之为混淆加密的东东,求助
- 大家帮帮我看下这我的菜单问题,要哭了..----------------!
- 【高难度】连文本框中输入的文字,一起POST出去!
- js面向对象编程中,如何调用脚本文件中定义的方法?
- textarea中光标在一个随意位置,javascript有什么办法能在光标后面加上自己定义的字符
- 请问可以用js将HTML文档中的表格输出吗?
- window.open()的中文问题。
- “var doc = top.treeFrame.window.document”这样的写法有错吗?为什么在本机正常,上传后就会报“top.treeFrame.window”不是对象的错??
- json数据怎么加上转义字符/
- 奇怪的JS
- 新人求帮助,我想在网站首页实现图片弹出式或下拉式的效果怎么做?
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head><body>
<form action="#" method="post" id="form1">
<select id="sel">
<option value="">--请选择--</option>
<option value="http://www.baidu.com">百度</option>
<option value="http://www.sina.com">新浪</option>
</select>
</form>
<script>
document.getElementById('sel').onchange =function(){
var value =this[this.selectedIndex].value;
document.getElementById('form1').action = value;
document.getElementById('form1').submit();
};
</script>
</body>
</html>
借用北北的代码
<form action="#" method="post" id="form1">
<select id="sel">
<option value="">--请选择--</option>
<option value="http://www.baidu.com">百度</option>
<option value="http://www.sina.com">新浪</option>
</select>
</form>
<script>
document.getElementById('sel').onchange =function(){
var value =this[this.selectedIndex].value;
document.getElementById('form1').action = value;
document.getElementById('form1').submit();
};
</script>