← #65 Show the first letter only
#66

Do not use submit to name a submit button

Topics: HTML

Given a form element, we often call the submit() method to submit the form after validating its fields.

If the submit button of the form has either name="submit" or id="submit" attribute, then formEle.submit will return the submit button instance.
As a result, formEle.submit() throws an exception because it's not an actual function anymore.

We can face the similar issue when using special properties of form such as reset, length, method.

<!-- Do NOT -->
<button type="submit" name="submit">Submit</button>
<button type="submit" id="submit">Submit</button>

<!-- Do -->
<button type="submit" name="submitButton">Submit</button>

More

Fix a typo or suggest an improvement
#67 Add a line break between inline elements