How to create HTML dropdown list with hyperlink without button

Tag: |   Category:

Paste below HTML code where you want the dropdown

<form name="form1">
<select name="menu1" id="menu1">
<option value="Select Category">Select Category</option>
<option value="">Joomla</option>
<option value="">WordPress</option>
<option value="">Moodle</option>
<option value="">Drupal</option>

Paste below Java before </body> tag (the hyperlink will open in same window)

<script type="text/javascript">
var urlmenu = document.getElementById('menu1');
urlmenu.onchange = function() {
document.location.href = this.value;

Paste below Java before </body> tag if you want it to open in new window.

<script type="text/javascript">
var urlmenu = document.getElementById( 'menu1' );
urlmenu.onchange = function() {  this.options[ this.selectedIndex ].value );

Copyright © 2024 Siam Naulak.