title: how do I use browser detection code to run certain HTML depending on detection result?
body: <p>I found this code snippet when I followed a link here on Stackoverflow.  It is exactly what I need, but I'm not sure how to implement it. I'd like to use it to run specific code depending on browser.  For example, if Firefox, then simply use linked Javascript, if IE/Chrome, then I'd like to use alternate code (HTML and JS).</p>
  
  <p>How can this be done?</p>
  
  <pre><code>var isOpera = !!window.opera || navigator.userAgent.indexOf('Opera') &gt;= 0;
  // Opera 8.0+ (UA detection to detect Blink/v8-powered Opera)
  var isFirefox = typeof InstallTrigger !== 'undefined';   // Firefox 1.0+
  var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') &gt; 0;
  // At least Safari 3+: "[object HTMLElementConstructor]"
  var isChrome = !!window.chrome;                          // Chrome 1+
  var isIE = /*@cc_on!@*/false;                            // At least IE6
  
  document.write('isFirefox: ' + isFirefox + '&lt;br&gt;');
  document.write('isChrome: ' + isChrome + '&lt;br&gt;');
  document.write('isSafari: ' + isSafari + '&lt;br&gt;');
  document.write('isOpera: ' + isOpera + '&lt;br&gt;');
  document.write('isIE: ' + isIE + '&lt;br&gt;');
  </code></pre>