<script>
function go()
{
window.location=document.getElementById("menu").value;
}
</script>
<body>
<form>
<select id="menu" onchange="go()">
<option>--Select a page--</option>
<option value="http://www.1.com">1</option>
<option value="http://www.2.com">2</option>
<option value="http://www.3.com">3</option>
</select>
</form>
</body>
this works perfectly, but I cant call the function from External File
$(document).ready(function() {
function go(){
window.location=document.getElementById("menu").value;
}});
By putting function go(){}" inside of "$(document).ready(function() { you enclosing the the go function within the scope of $(document).ready(function() {}
Use document.ready() to call a function, not to declare it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With