If we attempt code like this:
Column
or this:
Colu
-
My question is, why is colspan not an attribute of the DOM, and if it
is missing, how can the browser possibly render tables, since the
browser renders the DOM and not the HTML?
Colspan is an attribute of the DOM but it's not a property, so it's read only and browser renders it because it's an attribute.
Also, if I open my Chrome inspector, and go to the properties tab, why can I see colspan as a property of the Element?
The chrome shows both attributes and properties when you inspect it.
If you consider following,
A A
B
document.getElementById('xyz').colspan
results in undefined
Since it's not a property
but document.getElementById('xyz').id
results in xyz
Since it's a property
- 热议问题