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.

27th Aug 2020, 6:24 PM
Psycho
Psycho - avatar
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 " "
27th Aug 2020, 8:45 PM
maf
maf - avatar
27th Aug 2020, 6:34 PM
Namit Jain
Namit Jain - avatar