+ 2

Attributes

Challenge question: “All HTML elements can have attributes.” Answer: True. My question: What attributes can a <br />, <pre>, <head>, <title> or <!Doctype html> element have?

16th Jul 2022, 10:20 PM
Tahiti🌍Castillo
Tahiti🌍Castillo - avatar
10 odpowiedzi
+ 4
All HTML elements can have attributes due to global attributes. Global attributes are attributes common to all HTML elements; they can be used on all elements, though they may have no effect on some elements. https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes <!Doctype HTML> is not a HTML element, it is considered a preamble/ declaration. https://code.sololearn.com/Wc6oYR3W6iy0
17th Jul 2022, 8:45 AM
ODLNT
ODLNT - avatar
+ 5
Tahiti🌍Castillo I have been caught by the wording of that question also. There are quite a few with misleading statements, but don't allow it to upset you.
16th Jul 2022, 11:34 PM
Rik Wittkopp
Rik Wittkopp - avatar
+ 4
Rik Wittkopp Thank you for your understanding and civility.
17th Jul 2022, 12:26 AM
Tahiti🌍Castillo
Tahiti🌍Castillo - avatar
+ 3
ODLNT Thank you for this cogent explanation. I’m sure it will also be helpful to others. It’s the disclaimer, “though they may have no effect on some elements,” that clears everything up.
17th Jul 2022, 6:25 PM
Tahiti🌍Castillo
Tahiti🌍Castillo - avatar
+ 2
A͢J I have noticed that we all use the English language in slightly different ways, with a simple sentence being interpreted differently by individuals. English is my mother tongue, but quite often I note foreign speakers have a better understanding of the pure logic of the words.
17th Jul 2022, 5:22 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 2
Actually they can, using <br/> as an example has global and event handler attributes.
17th Jul 2022, 9:56 PM
Samuel T.P
Samuel T.P - avatar
+ 2
Samuel T.P I honestly had no idea that this was the case until today. I’ll need to brush up on event handler attributes. Thank you.
17th Jul 2022, 10:20 PM
Tahiti🌍Castillo
Tahiti🌍Castillo - avatar
0
A͢J So the <br /> element “can have” an attribute?
16th Jul 2022, 10:25 PM
Tahiti🌍Castillo
Tahiti🌍Castillo - avatar
0
A͢J Neither your question nor your answer above make any sense. Do I know the difference between “can have” and “have”? That’s an asinine, unhelpful question that seems like nothing more than an attempt to offend. There either is a possibility, or there is no possibility. “Might be possibility” makes no sense. If an example can’t be cited as precedent for the possibility, then there must not be a possibility.
16th Jul 2022, 11:19 PM
Tahiti🌍Castillo
Tahiti🌍Castillo - avatar
0
A͢J Again, there is no sense in your question, because it was snarky and unwarranted. I obviously know the difference between “can have” and “have”. Your answer makes sense to you. It does not make sense to me.
17th Jul 2022, 5:03 PM
Tahiti🌍Castillo
Tahiti🌍Castillo - avatar