How to register js condition for ie11?

Welcome.

Help right to prescribe the condition. If the version of internet explorer 11, when you add the parent class .ie11 styles child classes will only see ie11

Here is an example of such a script http://jsfiddle.net/L3p7P/4/

Need more simple and literate code.

Monsters JS help.

Scolded for the lazy who don't know how to use Google - googled and looked for the problem is that the brain is not enough for a more competent code, this turned back.

If you do not complicate, write it here http://jsfiddle.net/mDL3M/ so that the text "test" was green only in ie version 11
October 3rd 19 at 01:30
3 answers
October 3rd 19 at 01:32
Solution
There is a solution!

Here everything works http://jsfiddle.net/mDL3M/20/

Special thanks
The variant isIE11 var = document.body.style.msTextCombineHorizontal !== undefined; - Jennyfer.Olson commented on October 3rd 19 at 01:35
October 3rd 19 at 01:34
All right, now is not fashionable to check the version of the browser, but nevertheless:
var isIE11 = navigator.userAgent.match(/Trident\/7.0; rv 11.0/);


UPDATE:
User-agent can be: "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; BRI/2; rv:11.0) like Gecko"

The surest way perhaps this (not tested on IE < 11):
var isIE11 = document.body.style.msTextCombineHorizontal !== undefined;
hmm... if you please, write it here http://jsfiddle.net/mDL3M/ so that the text "test" was green only in ie version 11 - Jennyfer.Olson commented on October 3rd 19 at 01:37
http://jsfiddle.net/mDL3M/11/ - Blanch commented on October 3rd 19 at 01:40
not working( hooked up 2 jquery.x version and the other versions connected... - Jennyfer.Olson commented on October 3rd 19 at 01:43
To begin with. jQuery does not need for writing code. Further, judging from what is written here http://msdn.microsoft.com/en-us/library/ie/bg182625%28v=vs.85%29.aspx#uaString: User-agent has the following lines: for W8.1 (um, and just W8 even did not understand) : Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko as for W7 : Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko you probably still have some options http://jsfiddle.net/mDL3M/18/ try, unfortunately there are no windows systems, so look for yourself - Blanch commented on October 3rd 19 at 01:46
Thank you very much. Rewrote your code, took the line that added the class and it worked, now everything works http://jsfiddle.net/mDL3M/20/ thank you very much - Jennyfer.Olson commented on October 3rd 19 at 01:49
October 3rd 19 at 01:36
You need to look at the problem deeper under ие10-11 you can mark up anything like chrome/FF without using hacks. You just need the right approach and use normalize.css or reset.css. You understand that obveshivaya page hacks and checks the browser you're just very much impair the ability to maintain and upgrade this code in the future?

Find more questions by tags jQueryJavaScript