Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Change the text inside the

tag:

/*remember, in the previous section, the variable 'para' was set equal to the text in 
the first<p>, which was 'Hello'
//we can now change that text, by changing the variable's value*/
const para=document.querySelector('p');
para.innerText='Goodbye';console.log(para.innerText);
 
PREVIOUS NEXT
Tagged: #Change #text
ADD COMMENT
Topic
Name
7+1 =