I am working on implementing a select all
feature using AngularJS for text displayed in a structure similar to the one below. Once all the text is selected, users should be able to press ctrl + c
to copy it.
<div ="container">
<div class="header">My example header</div>
<div class="section1">
<span>test content1</span>
<span>test content2</span>
</div>
<div class="section2">
<span>test content3</span>
<span>test content4</span>
</div>
<div class="footer">footer content</div>
</div>
I need to create a button that, when clicked, will select all text within the container
div. Most examples I have come across show how to select text from a textarea or textbox, but I am specifically looking for a solution to select text from a range of HTML elements like in this scenario.