html5 - How to change the mobile safari's default text "0 items" when using the "multiple" attribute of the "select" tag? -
i using "multiple" attribute in html tag "select".
<select multiple> <option>1</option> <option>2</option> <option>3</option> <option>4</option> </select>
in mobile safari, default shows "0 items" in box. when selecting more 1 items, 3 shows "3 items" in box.
is possible change default text "0 items" else "select option(s)"?
yes. had play around see referring to, here's need: first option, add
<option disabled selected class="hidden">select option(s)</option>
where class hidden simply:
.hidden { display:none; }
then on focus, remove "selected" attribute / property of first option using jquery:
$('select').on('focus', function() { $(this).children(':first-child').removeprop('selected'); }
Comments
Post a Comment