Skip to article frontmatterSkip to article content
tools = require('../js/tools'); tools.init()
Loading...

HTML is based on tags

the HTML language structures the content of a web page in terms of sections, headers, paragraphs, lists of items, images ...

the language is based on tags written between < and > - for example <head>

an element (a section, a header, ...) is composed by

HTML document structure

the overall structure of a HTML document is composed of two parts, a header and a body, like this:

Loading...

browser and server

regular setup

usually the content gets fetched on the Internet
with the http:// protocol (or https..)

our setup today

but today, we will instruct the browser to get files from our laptop
hence the use of the file:// protocol

practice

you need to reproduce this:

Loading...

accessing your browser’s devel tools

check for devel tools

the Elements tab

the Console tab

another interesting part is the (JavaScript) Console tab
this is where debug messages end up (if any; here of course there are none)

the REPL

the area with the > is the REPL (i.e. Read, Eval, Print Loop) - juste like the >>> with Python
where you can type and run your first JavaScript code

DOM = Document Object Model

this HTML fragment

<html>
 <head>
  <title>top title</title>
 </head>
 <body>
  <p>a paragraph</p>
  <p>a paragraph</p>
 </body>
</html>

will result in this tree

be rigourous

do not do this !!

Loading...

do this instead

Loading...

a few tips