r/webdev - The reason for using the class attribute in this script example

I’m confused as to why you couldn’t just use an id attribute instead or if this a good example of using the class attribute. I ask this because in the example the class attribute is being used on just the <p> element. Or is the class attribute being used because their is the value “important” being used twice on the page (I read no two elements can use the same value for their id attribute so that’s why I ask this question)?



Source link

Write A Comment