How to copy text from a div to clipboard
<p>Here is my code for when the user clicks on this button:</p>

<pre><code>&lt;button id="button1"&gt;Click to copy&lt;/button&gt;
</code></pre>

<p>How do I copy the text inside this div?</p>

<pre><code>&lt;div id="div1"&gt;Text To Copy&lt;/div&gt;
</code></pre>