Animations

API

Arrays

Async

Basics

Challenges

Classes

Console

Dates

Debugging

DOM Elements

DOM Methods

DOM Navigation

DOM Properties

Event Listeners

Flow Control

Forms

Functions

Global Functions

JSON

Keywords

Libraries (3rd party)

Math

Modules

Objects

Snippets

String

Types

Widgets

Window Object

JavaScript - Children

You can also identify an item in the DOM and get a collection of its children. Like so:


  • Price: $9.99
  • Artist: Van Gogh
  • Title:
  • Description: Self-portrait


let productInfo = document.getElementById("product-props");
let price = productInfo.children[0].innerHTML;
document.getElementById("demo1").innerHTML = price;