HTML - select and go to URL with onchange event attribute

0 votes
2,212 views
added Apr 2, 2019 in HTML by LC Marshal Captain (25,770 points)
<select class="form-control" onchange="location = this.value;"> 
    <option selected="" value="" disabled>Select years</option>
    <option value="year-2019">2019</option>
    <option value="year-2018">2018</option>
    <option value="year-2017">2017</option> 
    <option value="https://lazacode.org">Parent website</option>
</select>

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...