Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

.textContent

//Allows you to change the inner text of an HTML element.
//Example:
//<p id="greeting">I'm just a paragraph.</p>

let greetingChange = document.getElementById("greeting") //Gets the above HTML paragaph

greetingChange.textContent = "I have changed!";//Changes the text inside the paragraph from "I'm just a paragraph." to "I have changed!".
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
3+3 =