Is "name" attribute mandatory in <input>, <textarea> and <button> elements?
forms, html, javascript
Solution
- If these tags are inside a `form` tag and you are subbmitting that form to a server, then name is required,
- If you are just using them for client-side purposes and don't want to send them to server, then it is optional.
Problem
Is `"name"` attribute mandatory in `<input>`, `<textarea>` and `<button>` elements? Or maybe we can use `id` or `class` instead?