Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Well, can they? I don't have the time to test, but if you gave an element two classes and in JS asked for its className, what would it return?
Im assuming the most recent class applied. Either that or the two classes seperated by some sort of delimiter. -
@AlgoRythm Having multiple is kinda the whole point of classes.
In JS, className is the string value of the class attribute, which is all classes, separated by spaces. -
@franga2000 Nah, ya got it backwards. The point of classes is multiple different elememts can have the same class, as opposed to id. It is also true that elements can have multiple classes, but this isn't the main idea.
-
@AlgoRythm Right, fair point. It's still something that is mentioned in the first paragraph on W3Schools. I really hope he won't be teaching us HTML next year
Related Rants
-
johnny17Coding Teacher: "you'll need your laptops for the exam. To prevent you from cheating I'll disable the network ...
-
MoboTheHobo17//long rant but worth it ;) In our class, we had some writing in Word. I was the smart PC guy in the class w...
-
W-DnD20Told us to use facebook or google drive to share code instead of git
The time I had to explain to my CS professor that HTML elements can in fact have multiple classes.
undefined
wk44
he had no idea