You can target older versions of Internet Explorer (<= 9) to classes in the <html> element ...
<html>
... and then check if the <html> class is .lt9 or .lt8 - any version of Internet Explorer that you are targeting:
if($('html').hasClass('lte9')) { }
However, I would suggest using Modernizr feature detection instead of checking for a specific browser.
source share