Why does it show blank white after button work
6/1/2020 3:00:53 PMAsef Dian🇧🇩
7 AnswersNew Answer
Set button type attribute as "button" <button type="button" onclick="greet()">Click</button> Don't name your JS function "submit", it calls for form submission (unsupported in SoloLearn).
Ipang My sincere apologies - I had never heard that before. Thanks for teaching me something new! 👍
Ipang type="button" is for <input> tag - not necessary for <button> 😉
Russ The default value for button "type" attribute is 'submit', it is recommended to set the button's "type" attribute value as 'button' when we wish to link the button with JS. It is not necessary when a button is expected to function or behave similar to a <input> with "type" attribute set as 'submit' 😁 https://dev.to/clairecodes/why-its-important-to-give-your-html-button-a-type-58k9 https://html.com/attributes/button-type/ (Edited)
Russ I also learned from your answers brother, no apologies was even needed 🤗
Because you are submitting the form for which you need php or any serverside handler.