0

What?? Where did my button gone!! Please someone help me with this JavaScript who ate my button..

Ok, you're here so this is the matter.. i am trying to create a small game where computer choose a random number and player have 5 attempts to guess it. After each wrong attempt game will tell player that the guess is HIGH or LOW than the correct answer...(it is not random yet, we'll fix this problem first). But here is a little problem, after the document.write() function is writing something, the text written in the body section is gone.... So anyone have explanation and solution about this.. https://code.sololearn.com/WPx3QXW5BrnH/?ref=app

18th May 2020, 10:31 AM
Pradeep Kumar Prajapati
Pradeep Kumar Prajapati - avatar
3 Answers
+ 4
Explanation: Using document.write() after an HTML document is fully loaded, will delete all existing HTML. Solution: https://www.sololearn.com/learn/JavaScript/2752/
18th May 2020, 10:49 AM
ODLNT
ODLNT - avatar
+ 1
Ok.. Thank you ODLNT for the explanation. I will keep it in my mind next time working with it. Thanks again.
18th May 2020, 10:59 AM
Pradeep Kumar Prajapati
Pradeep Kumar Prajapati - avatar
0
Note :- there is a comment in line 6 in JS remove the "//" and this is almost how the game is supposed to run.. thank you..
18th May 2020, 10:34 AM
Pradeep Kumar Prajapati
Pradeep Kumar Prajapati - avatar