title: How to detect onclick event only smart phone and tablet using javascript?
body: <p>How to detect <code>onclick</code> event only smart phone and tablet using <code>javascript</code> ?</p>
  
  <p><a href="https://jsfiddle.net/d87zjbLp/3/" rel="nofollow">https://jsfiddle.net/d87zjbLp/3/</a></p>
  
  <p>i use this code, but i want to call function <code>myFunction()</code> only on smart phone and tablet only (not on pc and notebook) </p>
  
  <p>How can i do that ?</p>
  
  <pre><code>&lt;script&gt;
  function myFunction() {
      alert("test");
  }
  &lt;/script&gt;
  </code></pre>