title: Copy Wordpress Title in backend
body: <p>So, I have a CPT and I have added some Custom Columns in the backend. I have this button at the side and it should copy the title. I was using Javascript for this and it is not working.</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 myFunction() {
    var copyText = document.getElementById("clickTitle");
    copyText.select();
    document.execCommand("copy");
    alert("Copied the text: " + copyText.value);
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.click-title{
  display: none;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>echo the_title( '&lt;h4 class="click-title" id="clickTitle"&gt;', '&lt;/h4&gt;' );
  echo '&lt;button class="btn btn-danger btn-sm" onclick="copyFunction()"&gt;Copy Title&lt;/button&gt;';</code></pre>
  </div>
  </div>
  </p>
  
  <p>But it is not working. I want the button to copy the title and I can't find a way to do that. I tried more than that.</p>
  
  <p><a href="https://i.stack.imgur.com/E2rHe.png" rel="nofollow noreferrer">(Click here to view image) I want to copy the title when I click Copy Title button. </a></p>