Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts
Getting and Setting Attributes

Getting and Setting Attributes

All HTML elements have a large number of possible attributes such as class , id ,  src , and href . The DOM API contains getter and setter m...
Finding the Value of a Node

Finding the Value of a Node

Finding the text contained within an element is actually trickier than it sounds. For example, the variable swim has a DOM node that contain...
Navigating the DOM Tree

Navigating the DOM Tree

Node objects have a number of properties and methods for navigating around the document tree. Once you have a reference to an element, you c...
An Example Web Page

An Example Web Page

To illustrate the DOM concepts covered in this chapter, we’ll use a basic web page that contains a heading and three paragraph elements. Sav...
The Document Object Model

The Document Object Model

What is the Document Object Model? The Document Object Model , or DOM for short, represents an HTML document as a network of connected no...
Quiz Ninja Project

Quiz Ninja Project

Now that we have come to the end of the chapter, it’s time to put what we’ve learned into practice in our Quiz Ninja project.  Since we’ve...
Comparison

Comparison

We often need to compare values when we are programming. JavaScript has several ways to compare two values. Equality Remember earlier, w...
Bitwise Operators

Bitwise Operators

Bitwise operators work with operands that are 32-bit integers. These are numbers written in binary (base two) that have 32 digits made up of...
Logical Operators

Logical Operators

A logical operator can be used with any primitive value or object. The results are based on whether the values are considered to be truthy o...
Booleans

Booleans

There are only two Boolean values: true and false . They are named after George Boole, an English mathematician who worked in the field of a...
Null

Null

Null means "no value". It can be thought of as a placeholder that JavaScript uses to say "there should be an value here, but ...
JavaScript Numbers

JavaScript Numbers

Number can be integers (whole numbers, such as 3) or floating point decimals (often referred to as just "decimals" or "floats...
Variables

Variables

Variables Variables are common in programming languages. They are a way of storing a value in memory for later use. In JavaScript, we star...