What are the formal categories for HTML attribute types

Hi, first of all I am really sorry if this is not the correct place to ask such a question - I did not want to post it on StackOverflow because that is a very toxic place for this type of noobie questions :worried:.

So as I was reading HTML element reference on MDN, I found that there are:

  • boolean attributes like autoplay, muted, loop, that are either true or false.
  • enumerated attributes like crossorigin, preload, which have predefined values.

Which led me to think what would be the proper category name for attributes like class, id - which can have any value assigned to them (as long as they follow some rules). Also, for completeness, are there only three categories for attributes: boolean, enumerated, and whatever class, id etc are called; or are there others as well.

Thanks a lot in advance :smile:

This is the second time (out of the two times I have posted on this forum) that my post got temporarily hidden by Akismet. I do not know why :cry:.

Hi @akaabdullahamateen and welcome to the community :wave:

That’s a pity :slightly_frowning_face:. Akismet is an anti-spam bot the automatically hides posts it thinks are spam. I can’t see any reason why it should have hidden this post. Is your second post still hidden? I can’t see it on your profile. On the positive side, after a manual review the bot should learn from its mistakes and such things should happen less often.

That’s an interesting question! :smiley:
I never heard about a specific name for these attributes, either. I had a look at the HTML specification and, like MDN, they talk about attributes in general and boolean/enumerated ones.
I think the reason for this is that by default attributes can have arbitrary names and if this isn’t the case they are put into one of this special categories to show this difference.
There aren’t any more categories in the spec, either.

I hope that makes it clearer. Feel free to come back whenever you have more questions. :slightly_smiling_face:

Have a nice day,

1 Like

Thank you so much for such a positive reply :smiley: and thank you for the information :blush:.

Have a nice day too :smiling_face_with_three_hearts: :slightly_smiling_face: :upside_down_face: :kissing_smiling_eyes: :kissing_closed_eyes: :hugs: :pleading_face: :grinning: :blush:,

1 Like