title: click to copy element's html code
body: <p><br>
  So what i'm trying to do basically is to create my own Bootstrap Cheat Sheet that would allow me to automatically copy and element's html code to the clipboard when I click on it or on a certain button.<br>
  A little bit like this site is doing : <a href="https://hackerthemes.com/bootstrap-cheatsheet/" rel="nofollow noreferrer">https://hackerthemes.com/bootstrap-cheatsheet/</a> <br>
  I know how to copy text but how to get access to the actual html code and copy it that i don't know how.<br>
  This is the code 'm using to copy text :<br></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-html lang-html prettyprint-override"><code>&lt;input type="text" value="Hello World" id="myInput"&gt;
  &lt;button onclick="myFunction()"&gt;Copy text&lt;/button&gt;
  &lt;script&gt;
    function myFunction() {
      var copyText = document.getElementById("myInput");
      copyText.select();
      document.execCommand("Copy");
      alert("Copied the text: " + copyText.value);
    }
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>would really appreciate some help ^^ </p>