I have created a curl command using the response which I got from API. But now I want to add functionality to copy that curl command, but I am not able to achieve it. I can't use the traditional way of using " document.getElementById(id).value " because in this I will get the HTML tags as well which I have used to form that command. I am providing an example so that it becomes more clear
<div class="attacks-detail-tab-value" id="request-curl" data-value="1">
<strong style="color: #0e1446;">curl --location --request</strong>
{{self.response.data1}}
<span style="color: black; word-break: break-word;"> '{{self.response.data1.url }}'</span> \
<strong style="color: #0e1446;"></strong>
<ul style="padding: 0; list-style-type: none;">
<li ng-repeat="(key, value) in self.response.head" style="margin-bottom: 5px;">
<strong style="color: #0e1446;">--header</strong>
<span style="color: black;">' {{ key }}: {{ value }} '
</span> \</li>
<span >
<strong style="color: #0e1446;">--data </strong> "{
<ul style="padding: 0; list-style-type: none;">
<li ng-repeat="(key, value) in self.response.param"
style="margin-bottom: 5px;"> {{key }}: {{ value }}
</li>}"
</ul>
</span>
</div>
You can see how I have created the curl command. And the curl command is getting created but now I want to copy that curl to the clipboard and I don't know how to do that. Can someone suggest some solution for it?