I want to JavaScript code that copy my text from class copy-text when I click to class copy-me. Here is my html
<div class="text">
<div class="text-wrapper">
<p class="copy-text">This will be copy</p>
<div class="bottom-element">
<span class="i-text">Share</span>
<span class="copy-me"> Copy Text </span>
</div>
</div>
</div>
<div class="text">
<div class="text-wrapper">
<p class="copy-text">This will be copy</p>
<div class="bottom-element">
<span class="i-text">Share</span>
<span class="copy-me"> Copy Text </span>
</div>
</div>
</div>
<div class="text">
<div class="text-wrapper">
<p class="copy-text">This will be copy</p>
<div class="bottom-element">
<span class="i-text">Share</span>
<span class="copy-me"> Copy Text </span>
</div>
</div>
</div>
I tried with
document.querySelectorAll('.copy-me').forEach(() => {
}
But It didn't work, help me on this, Thank you.