0

Its not working lol

I tried it in my own script.Its not working .-. <a href="https://www.google.com">Some link</a> <script> window.onload = function () { var tag = document.getElementsByTagName("a"); tag[0].href = 'http://www.sololearn.com'; }; </script>

25th Mar 2018, 9:09 AM
John Francisco
John Francisco - avatar
2 Réponses
+ 4
Please post the code in Code Playground and link it to your question. It will be easier to study your code in Code playground rather than in the question itself.
25th Mar 2018, 11:11 AM
Ekansh
+ 1
huuuuh is that supposed to work?🤔🤔 well from what I know it should be tag[0].setAttribute("href","link");
25th Mar 2018, 9:26 AM
᠌᠌Code X
᠌᠌Code X - avatar