PenciDesign Supporter replied
Staff Reply
Hi,
Please check the code I created below:
<label for="website-select">Choose a website:</label>
<select id="website-select" onchange="redirectToWebsite()">
<option value="">--Select an option--</option>
<option value="https://www.google.com">Google</option>
<option value="https://www.facebook.com">Facebook</option>
<option value="https://www.twitter.com">Twitter</option>
</select>
<script>
function redirectToWebsite() {
var select = document.getElementById('website-select');
var url = select.value;
if (url) {
window.location.href = url;
}
}
</script>
Regards,
PenciDesign.