These IE conditionals will give you a CSS class to key-off-of:
<!--[if lt IE 7]> <html class="lt-ie10 lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="lt-ie10 lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="lt-ie10 lt-ie9" lang="en"> <![endif]-->
<!--[if IE 9]> <html class="lt-ie10" lang="en"> <![endif]-->
<!--[if gt IE 9]><!--> <html lang="en"> <!--<![endif]-->
So if you only care about IE9, you could do:
<!--[if IE 9]> <html class="ie9" lang="en"> <![endif]-->
Or, to keep with convention:
<!--[if IE 9]> <html class="lt-ie10" lang="en"> <![endif]-->
Then your JS (and CSS) could key off the HTML.lt-ie10 selector:
if ($('HTML.lt-ie10').length) {
//this is IE9 and older
}
else {
//this is not IE9 and older (so it could be Chrome, or Safari or IE10, etc)
}