In this episode, you will learn how to traverse up and down the DOM tree with jQuery. In a previous episode, we talked about how JavaScript traverses through the DOM tree, node-by-node to fetch elements and manipulate them. How can you move up and down from a given node? Let’s look at the jQuery traversing commands: next() prev() closest() children()
Labs
Labs are hands-on coding projects that you build along with Tonya as she explains the code, concepts, and thought processes behind it. You can use the labs to further your code knowledge or to use right in your projects. Each lab ties into the Docx to ensure you have the information you need.
Each lab is designed to further your understanding and mastery of code. You learn more about how to think about its construction, quality, maintainability, programmatic and logical thought, and problem-solving. While you may be building a specific thing, Tonya presents the why of it to make it adaptable far beyond that specific implementation, thereby giving you the means to make it your own, in any context.
The Why of jQuery
Why would you want to use a library like jQuery? Why? It’s all about rapid web development. Libraries and frameworks allow you to write less code, which reduces your development time and costs. Let’s talk about the why of libraries like jQuery.
Select Elements from the DOM
In this episode, you will learn how to select elements (nodes) out of the DOM using both JavaScript and jQuery. You’ll learn what is returned, how to select by HTML tag, and how to select by an attribute, such as id or class. We’ll start with a discussion on the $ representation for jQuery.
Document Object Model (DOM)
What is the DOM? In JavaScript and its libraries and frameworks, including jQuery, it works with the DOM. Okay, what is it? This episode presents it to you. Further Reading: What is the DOM – on MDN W3C – Introduction to the DOM
Lab Introduction
This episode will discuss what you will learn in this hands-on lab. You’ll learn some basics of JavaScript, as you need it to understand jQuery; however, to learn JavaScript deeply, you will want to take JavaScript for WordPress. We also talk about why you want a library or framework. For example, PHP has Symfony and Laravel while Ruby has Ruby on Rails (RoR). JavaScript has different libraries and frameworks too, such as jQuery, React, Angular, Vue, and more. The purpose is to abstract away complexity and promote rapid development. Let’s talk about it.
Introduction to jQuery and JavaScript
jQuery provides you with a feature-rich suite of tools to simplify your JavaScript code. In this hands-on code building lab, you will be introduced to jQuery including JavaScript scoping, traversing the DOM, IIFE, functions, selecting elements, parameter handling and defaults, and more. This lab will introduce you to JavaScript fundamentals as well, as jQuery is a JavaScript library.