Merhabalar aldığım bir derste verilen js ödevinde bir buton var ve bu butona tanımlı bir resim var ve resme tıkladıgımda bir linke yönlendiriyor.İstenen şey ise Set Attribute methoduyla butona tıkladıgımda başka bir resim gelsin ve bu resimden başka bir linke gidilsin.
Uğraşıyorum ancak herhangi bir sağlıklı kaynağa rastlamadım.

Bu Konuda yardım edebilecek birileri var mıdır ?

<!DOCTYPE html><html>
<body>
<a href="https://www.nba.com/bulls" target="_blank"><img src="jordan.jpg" width="600" height="400"></a>
<br><br>
<button onclick="myFunction()">Click here to change the image and hyperlink</button>
<script></script>
<h3>Set Attribute Exercise</h3>
<p>1) In the function "myFunction()", which will be called when you click on the button, use the "document.getElementsByTagName()" method together with the "setAttribute" method for changing the "href" value of the hyperlink as "https://www.nba.com/lakers" and the "src" value of the image as "bryant.jpg".</p>
</body></html>