title: Why using window.navigator.userAgent to retrieve the browser Explorer 11 is recognized as Mozilla? How retrieve the user angent and version?
body: <p>I am pretty new in JavaScript and JQuery and I am going crazy trying to implement a simple script that detect if the browser is <strong>Internet Explorer</strong> and its version.</p>
  
  <p>So I am doing something like this:</p>
  
  <pre><code>$( document ).ready(function() {
  
      //alert(navigator.appName);
      //alert(navigator.appCodeName);
      //alert(navigator.appVersion);
      //alert(navigator.platform);
      //alert(window.navigator.userAgent);
  
      var ua = window.navigator.userAgent;
      var msie = ua.indexOf("MSIE ");
  
      console.log("USER AGENT: " + ua);
      console.log("MSIE: " + msie);
  });
  </code></pre>
  
  <p>The problem is that running the page into <strong>Explorer 11</strong> into the console log I obtain this messages:</p>
  
  <pre><code>USER AGENT: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.3; GWX:QUALIFIED; ASU2JS; rv:11.0) like Gecko
  
  MSIE: -1
  </code></pre>
  
  <p>How is it possible that it is recognized as Mozilla and not as IE? </p>
  
  <p>I need to recognize if the browser is Internet Explorer and its version.</p>
  
  <p>How can I do this operation?</p>