document.queryselector 1

document.queryselector

//Pretend there is a 

with class "example" const myParagraph = document.querySelector('.example'); //You can do many this with is myParagraph.textContent = 'This is my new text';

Here is what the above code is Doing:
1. We’re selecting the

element with the class “example” and storing it in a variable called myParagraph.
2. We’re changing the text content of the

element to “This is my new text”.

Similar Posts