Search code examples
javascriptjqueryinternet-explorerinternet-explorer-9

show a div with jQuery if the user is on IE 9 and below


How could I detect (with jQuery) if the user is on IE 9 or below, and if they are .show() a div?

I have successfully done the below with jQuery for Android. How could I do a IE 9 AND below condition?

Done similar with Android. (would like a similar solution for IE 9 and below)

var ua = navigator.userAgent.toLowerCase();
var isAndroid = ua.indexOf("android") > -1; //&& ua.indexOf("mobile");
if(isAndroid) {
    // alert( "welcome" );
    $("#android").slideDown();
}

Solution

  • Duh... been a few years, since I busted one of these out..

    <!--[if lte IE 9]>
      <style>
        #ie { display: block !important;}
      </style>
    <![endif]-->