Below are two HTML snippets to let the user choose a language for the page:
- one uses
<select>
and<option>
s, - the other uses a
<div>
and alternated<input>
/<label>
s.
What I plan to do is pick one of those (or a better one, if one exists) and use CSS to customize the appearance of it such that something like the following would appear at the top right of the page, i.e. all alternatives should be show at the same time all the time on the page.¹
I any of 1 and 2 which is to be objectively preferred over the other?
Are there any pro and cons of 1 vs 2?
<select name="language" id="language" value="ENG">
<option>ITA</option>
<option selected="selected">ENG</option>
<option>FRE</option>
</select>
<div class="language">
<input type="radio" id="italian" name="fav_language" value="ita">
<label for="italian">Italiano</label><br>
<input type="radio" id="english" name="fav_language" value="eng" checked="checked">
<label for="english">English</label><br>
<input type="radio" id="french" name="fav_language" value="fre">
<label for="french">Français</label><br>
<div>
¹ I've obtained this static image via a <ul>
with 3 <svg>
s inside a corresponding <li>
, so I haven't bothered adding something like an external shadow to mark the selected language, but I'd do it at some point.