i want to change the selected item using option tag dynamically. The following values inside in the dropdown button are the links from another page. But the result, when i select a value in the dropdown button, the value of option tag is not changing.
Here is my code:
<select name="select_item" class="select_item" id="menu1" onchange="function();">
<option value="<?= base_url('index/products'); ?>">Default sorting</option>
<option value="<?= base_url('index/prod_sort1'); ?>">Sort by A to Z</option>
</select>
<script type="text/javascript">
var urlmenu = document.getElementById( 'menu1' );
urlmenu.onchange = function() {
window.open( this.options[ this.selectedIndex ].value,"_self" );
};
</script>