Multi page function with links on drop-down
I have put together a multi page function, so there are multiple pages within the same webpage, and I would like the links to the multiple pages to be accessible via a drop-down rather than normal links. I have found a code for this, however it doesn't seem to be working for some reason.
HTML Code:
<div style='width:400px; height:400px; background-color:white; border-style:solid; border-color:#000000; border-width:1px; overflow:hidden;'>
<script>
function goToPage(url)
{
if (url != "")
{
.open(url);
}
}
</script>
<form>
<label>Select a page:</label>
<select accesskey="S" onchange="goToPage(this.options(this.selectedIndex).value)">
<option selected>Please select one</option>
<option value="#page1">Page 1</option>
<option value="#page2">Page 2</option>
<option value="#page3">Page 3</option>
<option value="#page4">Page4</option>
</select>
</form>
<a name='page1'></a>
<div style='width:400px; height:400px; overflow:auto;'>
this is page 1
</div>
<a name='page2'></a>
<div style='width:400px; height:400px; overflow:auto;'>
this is page 2
</div>
<a name='page3'></a>
<div style='width:400px; height:400px; overflow:auto;'>
this is page 3
</div>
<a name='page4'></a>
<div style='width:400px; height:400px; overflow:auto;'>
this is page 4
</div>
</div>
Any help is greatly appreciated.
Thanks.