0

JS/HTML Problem

Does anyone know why the button and text field dissapears when I press it? And is there a way to make them not disappear? https://code.sololearn.com/W42ML69ChaCl/?ref=app

28th Jan 2022, 1:02 AM
Jory
2 Answers
+ 4
initially the document.write function will rewrite the entire webcode into <!DOCTYPE html> <html> <head></head> <body></body> </html> Then start to write what we passed into the parameter
28th Jan 2022, 2:45 AM
Kelvin Paul
Kelvin Paul - avatar
+ 2
Yes! document.write() will clear your page and then it shows what you've written! So, instead of document.write(), you can make a div tag and can control output from there only or use alert() or console.log() Happy Learning 🙂
28th Jan 2022, 1:09 AM
Abhiyantā
Abhiyantā - avatar