How do I copy text from a block of text

Hello everyone, I’ve been searching for many days about this and I couldn’t find anything that works, I would like to copy a text, all the text that is in a yellow text block by clicking on the button, I tried different codes of custom attributes but nothing worked even putting it correctly the script code in the

My goal is just to copy the text inside the yellow text block!
Screenshot_1

Hi Igor, try this;