Why do we need `for`, `id`, and `name`?

When writing the code for a Textarea Element, why do you need to add the for, id, and name?

<form> <label for="blog">New Blog Post: </label> <br> <textarea id="blog" name="blog" rows="5" cols="30"></textarea>
1 Like

you can, why shouldn’t this be possible? Default text is really useful

the for and id are used to associate the label and the element, the id can also be used for styling

the name is used form submission.

4 Likes

whats the big difference between id attribute and name atrribute

2 Likes

id is for styling and associating input element with label

name attribute is used when sending information to the back-end of your website.

8 Likes

are we learning back end in next section

no, that would be throwing you into the deep. Of course you ca google about form submission to get a general idea. be careful not to drown.

5 Likes

I have tried so many times but this is not working. Text area code academy
Can someone please help!