-1

Something like

<a href="www.somewhere.com">Click here.</a>

<div class="button">Button</div> /* when pressed, "href" link changes */

And when the button is pressed. the "www.somewhere.com" gets changed to a differend URL?

Thanks.

1 Answers1

1

Yes. Select the button and change the href attribute.

$("button").on("click", () => {
    $("a").attr("href", "newlink");
});
Sxribe
  • 819
  • 7
  • 16