+ 2
Why does removeChild not work?
Why can't the console identify my references to html elements with removeChild? Is it because it is in a function? I cant figure it out, any help would be appreciated. Thank you. https://code.sololearn.com/Wj08FS8TYDSe/?ref=app
16 ответов
+ 4
+ 2
I may not be doing it right but I don't think it works
https://code.sololearn.com/Wj08FS8TYDSe/?ref=app
+ 2
It usually always does
+ 2
I hadn't tried that yet, but it doesn't work because body is not defined before it is declared on line 12
+ 2
Ive checked a lot of websites, tried a few solutions without any luck, and havent really found any clear answers. Is there any surefire way to solve this?
+ 2
Sorry I missed your questions. I've updated my program and fixed the issues, if you still need it. You were overloading enter and show as both variables and functions.
+ 1
But that will cause another error. My buttons will not work because they are embedded in another function
+ 1
But when you do that, then type in a password shorter or longer than required, it says nothing
+ 1
When you enter a password that is too short or too long, it should say "That password is too short/long, please restart the program and try again"
+ 1
The JavaScript console does not recognize the type() function because it is in another function
+ 1
I just cant figure out why it doesn't work
+ 1
That's okay, I've got it figured out now
- 1
id must be in quotes id="pop".
Also that's not how removeChild() function works.
It takes node object as argument.
https://www.w3schools.com/jsref/met_node_removechild.asp
- 1
remove window.onload = type();
and wrap you entire code with that onload function.
- 1
Works for me when you also change child nodes to
body.childNodes [1]
body.childNodes [2]
- 1
Oh yeas you need to remove the type() function or call it right in the beginning after onload function