javascript - Link in a <select> with JS doesnt't work on Chrome. IE & FF it works -
one simple question:
why code works in ff , ie , in chrome doesn't?
<select class="langbox" name="forma"> <option class="text-option" onclick="window.location = 'http://www.myurl/it'" >italiano</option> <option class="text-option" onclick="window.location = 'http://www.myurl/en'" >english</option> <option class="text-option" onclick="window.location = 'http://www.myurl/de'" >deutsch</option> <option class="text-option" onclick="window.location = 'http://www.myurl/fr'" >français</option> <option class="text-option" onclick="window.location = 'http://www.myurl/ru'" >pусский </option> </select>
it doesn't redirect me on url want, nothing on chrome. in firefox , ie works.
<select class="langbox" name="forma" onchange="window.location ='http://www.myurl/'+this.options[this.selectedindex].value;"> <option class="text-option" value="it">italiano</option> <option class="text-option" value="en">english</option> <option class="text-option" value="de">deutsch</option> <option class="text-option" value="fr">français</option> <option class="text-option" value="ru">pусский</option> </select>
you don't click on options, change select. while browsers may tolerant of this, others may not (as have discovered). mobile browsers, may have different ui <select>
elements.
Comments
Post a Comment