+ 2
Error in js code
https://code.sololearn.com/W0yvk4bJgvMs/?ref=app Can anyone correct my JS code. I want to change href link but it's not working
2 Réponses
+ 4
You're making it way too difficult.
var el = document.getElementById('demo').getElementsByTagName("a");
el[0].href='https://www.sololearn.com';
+ 1
Thank you very much. I made it that way to practice using 'childNodes'. With ur answer i learned new method.:)