0
Can anyone please tell me the way to clear div value in html using javascript?
https://code.sololearn.com/WkMQPA7NslPI/?ref=app I want to clear the data inside div of id "summary" by tapping on reset button. I've tried both methods of GFG correct me if I'm doing wrong something. Reset function starts from line 89.
2 Answers
+ 5
Change the onclick of reset button to something else, such as resetForm() and don't pass any arguments inside,
Inside javascript, change function reset(form) to resetForm() without any parameters inside, now in the function just grab the form using getElementById and .reset() it, and grab the summary and change its innerHTML to " "