+ 5

JavaScript/HTML Problem

A while ago I asked a question that gave me a piece of code I'm using for something. Here's something that involves that: function jg() { while (y = document.querySelector('html > *')) { y.parentElement.removeChild(y); break; } } function nav(x) { jg(); document.write(x); } I used the function nav() as the onclick for some spans in a paragraph. I can onty click the "link" three times. Why is that? https://code.sololearn.com/W2APQEyBGaYB/?ref=app

27th Sep 2020, 6:34 PM
Dustin 🇺🇸
2 Respuestas
+ 3
So...
27th Sep 2020, 8:31 PM
Dustin 🇺🇸
+ 2
You did not show how your HTML looks like - could you please post the code on playground and link it here?
27th Sep 2020, 6:37 PM
Raj Chhatrala
Raj Chhatrala - avatar