JSFiddle - React, Tailwind, and code Playground

by grantk

HTML

<select id="test">
   <option>1</option>
   <option>2</option>
   <option>3</option>
   <option>4</option>
   <option>5</option>
</select>

JavaScript

var ddl = document.getElementById('test');
ddl.onchange = function(){
    //window.location = 'https://www.google.com.au/search?hl=en&q=' + ddl.options[ddl.selectedIndex].text;
    alert('yourwebsite.com/' + ddl.options[ddl.selectedIndex].text);
};