How I can inject html link in the Dom by JS

I had some module in the html,But the link doesn’t work now, so I need to make injection into Dom HTML by JS.
(Example)

<a class=”link” href=”ABC.com”

And put the script before the end of body html.Script will makes changing into the html, JavaScript will search class and clear href and add(toggle) it, it’s possible to do it without {id} of a, search by class ? Thank you friends.

To inject Dom href link , and change it for my link to other resource.