title: Click to copy text javascript
body: <p>Let me start with that i'm a beginner on javascript and I just about understand a click toggle.
  I am making a site like <a href="http://flatuicolors.com" rel="nofollow">flatuicolors.com</a> and it that when you click on a div, it will copy the colour. I have wrote each colour in the each div in a P tag and was wondering if you can click to copy the P tag in that div.</p>
  
  <pre><code>&lt;div class="main-colour-container col-group-1"&gt;
      &lt;div class="colours-featured" id="div2"&gt;
  
          &lt;div class="colour-box" style="background:#F22613;"&gt;
              &lt;div class="inside-colour-box"&gt;
                  &lt;div class="colour-box-text fade"&gt;
                      &lt;p&gt;#F22613&lt;/p&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class="colour-box" style="background:#F44336;"&gt;
              &lt;div class="inside-colour-box"&gt;
                  &lt;div class="colour-box-text fade"&gt;
                      &lt;p&gt;#F44336&lt;/p&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="colour-box" style="background:#C62828;"&gt;
              &lt;div class="inside-colour-box"&gt;
                  &lt;div class="colour-box-text fade"&gt;
                      &lt;p&gt;#C62828&lt;/p&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="colour-box" style="background:#DB3D45;"&gt;
              &lt;div class="inside-colour-box"&gt;
                  &lt;div class="colour-box-text fade"&gt;
                      &lt;p&gt;#DB3D45&lt;/p&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>