text

The opening <html> tag indicates that anything between it and a closing </html> tag is HTML code.

The <body> tag indicates that anything between it and the closing

</body> tag should be shown inside the main browser window.

Words between <h1> and </h1> are a main heading.

A paragraph of text appears between these <p> and </p> tags.

Words between <h2> and </h2> form a sub-heading.

Here is another paragraph between opening <p> and closing </p> tags

the loops

Conditional statements allow your code to make

decisions about what to do next.

Comparison operators (===, ! ==, ==, ! =, <, >, <=, =>)

are used to compare two operands.

Logical operators allow you to combine more than one

set of comparison operators.

if … else statements allow you to run one set of code

if a condition is true, and another if it is false.

switch statements allow you to compare a value

against possible outcomes (and also provides a default

option if none match).

Data types can be coerced from one type to another.

All values evaluate to either truthy or falsy.

There are three types of loop: for, while, and

do … while. Each repeats a set of statements.

document object

The browser represents the page using a DOM tree.

DOM trees have four types of nodes: document nodes,

element nodes, attribute nodes, and text nodes.

You can select element nodes by their id or cl ass

attributes, by tag name, or using CSS selector syntax.

Whenever a DOM query can return more than one

node, it will always return a Nadel i st.

From an element node, you can access and update its

content using properties such as textContent and

i nnerHTML or using DOM manipulation techniques.

An element node can contain multiple text nodes and

child elements that are siblings of each other.

In older browsers, implementation of the DOM is

cBrowsers offer tools for viewing the DOM tree .

instruction

A script is made up of a series of statements. Each

statement is like a step in a recipe.

Scripts contain very precise instructions. For example,

you might specify that a value must be remembered

before creating a calculation using that value.

Variables are used to temporarily store pieces of

information used in the script.

Arrays are special types of variables that store more

JavaScript distinguishes between numbers (0-9),

strings (text), and Boolean values (true or false).

Expressions evaluate into a single value.

Expressions rely on operators to calculate a value.

CSS

treats each HTML e XX lement as if it appears inside

its own box and uses rules to indicate how that

element should look.

Rules are made up of selectors (that specify the

elements the rule applies to) and declarations (that

indicate what these elements should look like).

Different types of selectors allow you to target your

rules at different elements.

Declarations are made up of two parts: the properties

of the element that you want to change, and the values

of those properties. For example, the font-family

property sets the choice of font, and the value arial

specifies Arial as the preferred typeface.

CSS rules usually appear in a separate document,

although they may appear within an HTML page.

••