[英]iDevices full screen scroll wheel
I have a dropdown, that I want to redirect the user depending on which option they select: 我有一个下拉菜单,我想根据用户选择的选项来重定向用户:
<script type="text/javascript">
function gotopage(selval){
var value = selval.options[selval.selectedIndex].value;
window.location.href=value;
</script>
<select style="float:right" onchange="gotopage(this)">
<option value="">Select</option>
<option value="http://www.lap.com">Google</option>
<option value="http://www.yahoo.com">Yahoo</option>
<option value="http://www.msn.com">MSN</option>
</select>
But, when I go change it, the page stays the same. 但是,当我进行更改时,页面保持不变。 Any idea why? 知道为什么吗?
Your javascript function has no closing }
bracket 您的javascript函数没有结束}
括号
Here is it working as you expected with the bracket added: http://jsfiddle.net/3Hfhr/ 这是您期望的工作,并添加了括号: http : //jsfiddle.net/3Hfhr/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.