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
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
+ 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 đ