Copy a text from a div and download an image using a tag


#1

I want to copy a text from a div tag.

<div id="copy">
            <p>Copy this text !</p>
            </div>

any suggestion how can i do it ?

  • AND -

i also want to download image using

<a href="" download></a>

#2

By default, the reduced version of jQuery you have available with angular does not provide DOM selectors by class or id.
https://docs.angularjs.org/api/ng/function/angular.element

If it works for you, you can work with the oposite aproach.
You may have a {{theText}} in the template in and $scope.theText in the controller.
Then you just have to update the variable content to change the text.