JSFiddle - React, Tailwind, and code Playground
by techiedelight
HTML
<!doctype html>
<html lang="en">
<body>
<a href="https://www.bing.com/">Click Me</a>
<div>
<button id="submit">Change Hyperlink</button>
</div>
</body>
</html>
CSS
button {
font-size: 14px;
margin: 8px;
padding: 3px;
}
JavaScript
document.getElementById('submit').onclick = function(e){
var anchors = document.querySelectorAll('a[href]');
anchors.forEach (function (a) {
a.href = "https://www.google.com/";
console.log("Hyperlink Changed");
});
}