const p = document.querySelector('p');
// Create a constant that will get the first 'p' element on the page. Works like CSS selector. #div p
document.addEventListener('DOMContentLoaded', function);
//make it wait until the DOMContent is loaded to start the function.
A NodeList is not an Array. It doesn't have the methods.
const p = document.querySelectorAll('p');
//get or select all the p elements on the page.
// Create a constant that will get the first 'p' element on the page. Works like CSS selector. #div p
document.addEventListener('DOMContentLoaded', function);
//make it wait until the DOMContent is loaded to start the function.
A NodeList is not an Array. It doesn't have the methods.
const p = document.querySelectorAll('p');
//get or select all the p elements on the page.
No comments:
Post a Comment