Question about ''name'' in set of checkboxes in html

I came to the challenge where im learning to put checkboxed in HTML/CSS, so i had example of < label>< input type=’ ’ checkbox ‘’ name= ‘’ personality ‘’>Loving < /label>

So im interested if we can give it any name besides personality? Or it has to be related to described aka named checkbox? Thanks.

Any name will do but it makes sense to give it a descriptive name so you know what set of elements you are referring to/pulling the data from. I.e. Maybe you had a second set of check boxes on the page that referred to the animals ‘appearance’. It would get confusing if you just instead called these ‘animal1’ and ‘animal2’.

Using a descriptive name allows reference in the DOM and helps keep the code clear/easy to read understand. However there are no ‘special properties’ of names, that is ‘personality’ here is not a function or represents anything ‘special’. You could just as well use ‘attitude’ for the name.

1 Like