title: How to detect touch device browsers vs desktop using javascript?
body: <p>What is the code to detect touch devices (smartphones and tablets) vs desktops browsers using userAgent.match and return a boolean variable (for example 'isipad')?</p>
  
  <p>I need to test this against Android and Apple devices mainly. If the device browser is Android or Apple, return isipad = false. Else, return isipad = true.</p>
  
  <p>So far I went about it like this (for iDevice browser detection) :</p>
  
  <pre><code>if( navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) ||navigator.userAgent.match(/iPad/i) )
  {var isipad = true;}
  else
  {var isipad = false;}
  </code></pre>
  
  <p>It seems to work, however I would love to be able to add the android browser as well, in this case.</p>
  
  <p>Thanks in advance.
  Alex</p>