I'm attempting to create a dropdown menu with links, but I only want to use parameters in the URL, not the entire file name.
Below is the code snippet:
<script type="text/javascript">
function goToNewPage(){
var url = document.getElementById('list').value;
if(url != 'none') {
window.location = url;
}
}
</script>
<select name="list" id="list" accesskey="target">
<option value='none' selected>Choose an item</option>
<option value="?one">item1</option>
<option value="?two">item2</option>
<select>
<input type=button value="Go" onclick="goToNewPage()" />
If I utilize: <option value="index.html?one">item1</option>, it functions correctly. However:
How can I make it work like this:
<option value="?one">item1</option> ?