JS - Select and target blank with window.open

0 votes
125 views
added Apr 3, 2019 in Javascript by LC Marshal Captain (25,770 points)
// window.open for target blank
<select id="select-years" onchange="window.open(this.value)"> 
    <option selected="" value="" disabled>Select years</option>
    <option value="year2019" >2019</option>
    <option value="year2018">2018</option> 
    <option value="https://lazacode.org">External ste</option>
</select>

 

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