title: copy url to clipboard only some text from link
body: <p>I am using given below code to copy url, but i am thinking about something different like in given example -- <a href="https://oauth2.example.com/code?state=state_parameter_passthrough_value&amp;code=4/0AdQt8qg5KBjhjcHixOZMVfpO4cl_UB8NpoV9-GxBzeiI8xCH_8oqzmYhXvGrAx1SyEFYyQ&amp;scope=https://www.googleapis.com/auth/drive.metadata.readonly" rel="nofollow noreferrer">https://oauth2.example.com/code?state=state_parameter_passthrough_value&amp;code=4/0AdQt8qg5KBjhjcHixOZMVfpO4cl_UB8NpoV9-GxBzeiI8xCH_8oqzmYhXvGrAx1SyEFYyQ&amp;scope=https://www.googleapis.com/auth/drive.metadata.readonly</a></p>
  <p>This is the complete url. But i wanted to only copy in clipboard THis ---</p>
  <p>4/0AdQt8qg5KBjhjcHixOZMVfpO4cl_UB8NpoV9-GxBzeiI8xCH_8oqzmYhXvGrAx1SyEFYyQ</p>
  <p>If this is possible, please somebody guide me.</p>
  <p>here the html</p>
  <pre><code> &lt;div class=&quot;container&quot;&gt;
          &lt;div class=&quot;label&quot;&gt;
              E-mail address
          &lt;/div&gt;
          &lt;div class=&quot;copy-text&quot;&gt;
              &lt;input type=&quot;text&quot; class=&quot;text&quot; value=&quot;david@stylus.co.za&quot; /&gt;
              &lt;button&gt;&lt;i class=&quot;fa fa-clone&quot;&gt;&lt;/i&gt;&lt;/button&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  <p>here the java script:</p>
  <pre><code>let copyText = document.querySelector(&quot;.copy-text&quot;);
  copyText.querySelector(&quot;button&quot;).addEventListener(&quot;click&quot;, function () {
      let input = copyText.querySelector(&quot;input.text&quot;);
      input.select();
      document.execCommand(&quot;copy&quot;);
      copyText.classList.add(&quot;active&quot;);
      window.getSelection().removeAllRanges();
      setTimeout(function () {
          copyText.classList.remove(&quot;active&quot;);
      }, 2500);
  });
  </code></pre>