css - Hide 'option' element in iphone -


here html:

<select>    <option style="display:none;">1</option>    <option>2</option>    <option>3</option>    <option>4</option> </select> 

here result on chrome - desktop

chrome desktop

and here result in iphone - safari

iphone safari

jsbin

you disable or remove using jquery

demo http://jsfiddle.net/fa8xx/1728/

<select>    <option class="targetthis">1</option>    <option>2</option>    <option>3</option>    <option>4</option> </select> 

jquery

function isiphone(){     return (         (navigator.platform.indexof("iphone") != -1) ||         (navigator.platform.indexof("ipod") != -1)     ); } if(isiphone()){    $(".targetthis").attr('disabled', true); } 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -