Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Get the text inside a paragraph


const para=document.querySelector('p');
console.log(para.innerText); //innerText is a property of the para-variable NOT a method. (methods have())
//to get the property of a variable, put a period after the variable name.
 
PREVIOUS NEXT
Tagged: #Get #text #paragraph
ADD COMMENT
Topic
Name
3+9 =