title: Copy text of a specific tag to clipboard using JavaScript
body: <p>I want to copy input to my clipboard using javascript so is there any way I can do,Thanks</p>
  <p><strong>WITHOUT MAKING AN INPUT FIELD</strong></p>
  <p>JavaScript And HTML</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function copy(input){
    
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;p&gt;Text To Copy = hi &lt;button type="button" onclick="copy('hi')"&gt;click to copy&lt;/button&gt;&lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>