I have got a problem with JavaScript. I want to add a drop down list control with a link as Value of it. After it will be choosen and clicked button it schould redirect me to chosen link. I tried this code from this Article:
https://stackoverflow.com/questions/19843373/linking-to-other-pages-in-html-via-drop-down-menu
<select name="list" id="list" accesskey="target">
<option value='none' selected>Choose a theme</option>
<option value="index.html">Theme 1</option>
<option value="theme2.html">Theme 2</option>
<option value="theme3.html">Theme 3</option>
<select>
<input type=button value="Go" onclick="goToNewPage()" />
<script type="text/javascript">
function goToNewPage()
{
var url = document.getElementById('list').value;
if(url != 'none') {
window.location = url;
}
}
but when I tried to add by the script, or by html on site, or by designer its erase me that sort of text:
<input type=button value="Go" onclick="goToNewPage()" />
It's live only:
<input type=button value="Go" />