title: Copy the text to the Clipboard without using any input
body: <p>I just saw many articles in the web to find a solution to copy text to the Clipboard. But Every tutorials explain with inputs examples.</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 GeeksForGeeks() {
              var copyGfGText = document.getElementById("GfGInput");
              copyGfGText.select();
  
              document.execCommand("copy");
  
              alert("Copied the text: " + copyGfGText.value);
            }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>  &lt;input type="text" value="GeeksForGeeks" id="GfGInput"&gt;
  
           &lt;!-- The button used to copy the text --&gt;
           &lt;button onclick="GeeksForGeeks()"&gt;Copy text&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>But I need to copy just a simple text.
  Is there a way to copy simple string from variable to the Clipboard?
  example`</p>
  <pre><code>let text = &quot;copy this text to the clipboard&quot;;
  </code></pre>