Attributes | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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 Answers
+ 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