DEV Community

Russell Jones
Russell Jones

Posted on

HTML DOM ๏ธloves Javascript! ๐Ÿ’• #TLA ๐Ÿ˜˜

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...?

<table> DOM

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;
Enter fullscreen mode Exit fullscreen mode

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...

Kickass geocities site

Written with StackEdit.

Goodbye Ace

Top comments (0)