Book Image

Advanced JavaScript

By : Zachary Shute
Book Image

Advanced JavaScript

By: Zachary Shute

Overview of this book

If you are looking for a programming language to develop flexible and efficient applications, JavaScript is an obvious choice. Advanced JavaScript is a hands-on guide that takes you through JavaScript and its many features, one step at a time. You'll begin by learning how to use the new JavaScript syntax in ES6, and then work through the many other features that modern JavaScript has to offer. As you progress through the chapters, you’ll use asynchronous programming with callbacks and promises, handle browser events, and perform Document Object Model (DOM) manipulation. You'll also explore various methods of testing JavaScript projects. In the concluding chapters, you'll discover functional programming and learn to use it to build your apps. With this book as your guide, you'll also be able to develop APIs using Node.js and Express, create front-ends using React/Redux, and build mobile apps using React/Expo. By the end of Advanced JavaScript, you will have explored the features and benefits of JavaScript to build small applications.
Table of Contents (9 chapters)

DOM Chaining, Navigation, and Manipulation


The Document Object Model (DOM) is an interface for HTML documents. The DOM represents a web page in such a way that programs can change the document structure, style, and content. The DOM is the object-oriented representation of a web page.

There are two standards for the DOM: the World Wide Web Consortium (W3C) standard and the Web Hypertext Application Technology Working Group (WHATWG) standard. WHATWG was developed in response to the slow development of the W3C standard. Both standards define HTML elements as objects that can be accessed by JavaScript code, and properties, accessor methods, and events for all HTML elements. DOM object methods are actions you can perform on HTML elements and DOM object properties are values you can get or set. The DOM standard provides a way for JavaScript to add, get, change, or delete HTML elements programmatically.

Note

The W3C DOM standard and WHATWG DOM standard are implemented by most modern browsers (Chrome...