try it: var copy_text_val = document.querySelector('.copy_text'); Copy a Textarea's Value to the Clipboard; Display Success Messaging; Copy a Textarea's Value to the Clipboard. The HTML editor of Microsoft Visual Studio has a feature by which when you copy text to the Clipboard from Internet Explorer, two versions of the text become available: an HTML version and a text version. Place the code in angular HTML template: < div #container > < button ngxClipboard [cbContent] = " ' CTC Inline Text. ' Use HTMLInputElement.select () to select the contents of the