How to detect IE7 with javascript or jquery and add a class to div
Translations
Englishالعربية
български
català
中文
čeština
dansk
Nederlands
eesti
suomi
français
Deutsch
Ελληνικά
עברית
हिंदी
magyar
Bahasa Indonesia
italiano
日本語
한국어
latviešu
lietuvių
norsk
polski
Português
română
русский
slovenčina
slovenski
español
svenska
ไทย
Türkçe
українська
Tiếng Việt
Is there any way to detect IE7?
I don't have any problems with my codes in IE8, but I have a problem with IE7.
So what I thought is that I can add a class with jquery when a browser is IE7 detecting it by javascript.
I want to change from
<div id="system">
to
<div id="system" class="ie7">
Thanks in advance.
This question and answers originated from www.stackoverflow.com
Question by shin (9/8/2010 5:02:43 PM)
Answer |
You could use an IE conditional comment to add the class via javascript, something like this:
<!--[if IE 7]>
<script type="text/javascript">
$(document).ready(function() {
$('#system').addClass('ie7');
});
</script>
<![endif]-->
Answer by Jimmy
Find More Answers
Related Topics javascript jquery internet-explorer-7