Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

The .querySelector() Method

// Select the first <div>
const firstDiv = document.querySelector('div');
 
// Select the first .button element inside .main-navigation
const navMenu = document.getElementById('main-navigation');
const firstButtonChild = navMenu.querySelector('.button');
Source by www.codecademy.com #
 
PREVIOUS NEXT
Tagged: #The #Method
ADD COMMENT
Topic
Name
4+4 =