Our target: DOM. Yes, that. I don't know what it is, you don't know what it is, who gives a f---? Javascript is to be learned.
DHTML couldn't cut the mustard!
Dynamic HTML is like DOM's daddy if SGML were his mum.
And Javascript joined in for a 011 way while Netscape watched...
Anyway,
- Document
- Object
- Model
It's a programming interface... or a way to make your webpages juicy with Javascript!
Horses mouth: https://www.w3.org/TR/WD-DOM/introduction.html
W3.org
We luh-luh-luv you! They gestated and nurtured the spec. They fought over bike sheds! All for us!!
DOCUMENT
- A DOCUMENT is an HTML webpage
- A DOCUMENT is also an XML document (but we won't talk about that right now!)
OBJECT MODEL
It's like looking under a TABLE's dress, or under a table wearing a dress...?
So what?
Well, now you can contrive up a little action:
let content = "";
const myObj = { foo: "bar" };
myObj.fooBar = () => {
content = myObj.foo;
};
myObj.fooBar();
document.getElementById("app").innerHTML = content;
If only you had a <div id="app"></div>
...
https://codesandbox.io/s/zen-fog-u1748f?file=/index.html:105-125
Javascript looks at DOM seductively...
Written with StackEdit.
Top comments (0)