In my site, every h2 tag is containing copy to clipboard icon, so when I hit the copy icon button, the URL should copy including div id.
Example, the absolute URL is “mysite dot com” and the div id is “process-invoices” so when I click on the copy button then the url should copy like this “mysite.com/#process-invoices”
<div class="wrapper" id="process-invoices">
<h1>Process invoices</h1>
<button onclick="copy absolute url with above div id value">Copy to Clipboard</button>
</div>