DOM not working | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson

DOM not working

When i press button == change text in <a> element, whole html disappears. Where is the problem? Edit: even when i don't chenge the text, just clicking the button, causes the problem

20th Jan 2020, 7:31 AM
Maneren - avatar
2 Answers
+ 2
add type="button" to your <button> tag: default type is "submit" wich imply form sending on click...
20th Jan 2020, 8:11 AM
visph - avatar
visph yep, already got it, thx
24th Jan 2020, 12:31 PM
Maneren - avatar