▲ | CharlieDigital 3 months ago | ||||||||||||||||
In what way can an `HTMLDivElement` not emulate a `class Rectangle`?
What can you do with a `class Rectangle` from a GUI perspective that you can't do with an `HTMLDivElement`? | |||||||||||||||||
▲ | RandomThoughts3 3 months ago | parent [-] | ||||||||||||||||
A class Rectangle can be whatever you want. You can overload it. You can change everything including how it’s rendered. It doesn’t have to be any of the things you list. A div element is a node in a tree which will be rendered by your browser in the way specified by the spec. You absolutely can’t freely do most of the actions you list to a div. There are severe limitations. A div doesn’t at all emulate a class. Its semantically something completely different. | |||||||||||||||||
|