title: Copy text button not working, I keep getting things saying that blank is not a function
body: <p>so I’m trying to make a button that copy’s the paragraph tag with the ID of “n” onto the clipboard, but I keep getting errors saying that select is not a function, and other things are not a function, what am I doing wrong?</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta name=&quot;viewport&quot; content=&quot;width=320, initial-scale=1&quot;&gt;
  &lt;meta charset=&quot;utf-8&quot;&gt;
  &lt;style&gt;
  body, html {
  min-width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  font: Arial 14px;
  }
  &lt;/style&gt;
  
  
  &lt;script&gt;
  function n() {
  
  var ntext = document.getElementById(&quot;n&quot;);
  
  ntext.select(); 
  ntext.setSelectionRange(0, 99999);
  
  document.execCommand(&quot;copy&quot;);
  
  alert(&quot;could be copied&quot;)
  
  }
  &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;input&gt;
  
  &lt;button onclick=&quot;n()&quot;&gt;
    Click
  &lt;/button&gt;
  
  &lt;p id=&quot;n&quot;&gt;
  ee
  &lt;/p&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;      
  </code></pre>