+ 2
Div or buttons: what do you prefer and why
I built a calculator using html,css and js. I went into the create section to get inspiration and how to go about it. I noticed that a lot of people used <div> for their form of inputs instead of buttons. Please why is that, is it a preference or a technical decision? ( I also noticed people using <div> in creating games as well). Your response is very much appreciated, Thank you!
4 ответов
+ 2
You can use both the button and div tags since both are customizable. However, I’d prefer using button because that’s what it’s meant for, isn’t it?
In game development, if you’re referring to custom elements, we often use div tags. Div tags serve as universal containers, ideal for custom elements like boxes or other objects. Tags like button and strong have specific purposes button for interactive buttons and strong for bold text so they’re generally not suitable for creating non-standard game elements.
+ 2
Yeah in my opinion buttons are more suitable
+ 2
Thank you Luo Shenshi
+ 1
Afolabi Oluwatobi You're welcome 🤗