I’m currently brushing up on HTML that I don’t use as often and learning new code, so go easy on me with the language in the responses as I’m still familiarizing myself with terms and new info.
I’m learning about values and inputs in forms and was becoming confused after I learned about Password, Number, and Range Inputs all having input type=“range/password/number” name=“item” id=“item”. I caught on slightly with those and thought, "Great! Id and names both have the same title for these three inputs. Then I began learning about checkbox inputs. I’m slowly catching on to why a value is included, but my question is why are the name and id no longer named the same thing? Here is some code I was learning from the courses:
label for=“pepperoni”>Pepperoni</label
input type=“checkbox” id=“pepperoni” name=“topping” value=“pepperoni”
I’m confused as to why the id and name no longer match when having the checkbox input? Thanks so much for your help.