Associate label with input. Include name in input. #92
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this contribution! Some changes requested in comments.
step1-03/demo/README.md
Outdated
@@ -6,7 +6,7 @@ In this demo we are going to cover a few core basics of the language that will h | |||
|
|||
```html | |||
<div id="contact-form"> | |||
<label>Email</label><input id="email" type="email" /> | |||
<label for="email">Email</label><input id="email" type="email" name="email"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this form won't be submitted via POST, the name property shouldn't be necessary as far as I'm aware. If you've seen guidance to the contrary, would you mind sharing a link?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are right. The name attribute is for server-side processing.
step1-03/demo/index.html
Outdated
> | ||
<pre data-lang="css"> | ||
|
||
<body> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you please revert all the changes to this file aside from adding the for
attribute to the label?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Gave the label element a for attribute to link it to its corresponding input element. Also added name attribute to input. Those are best practices.