Answers for "js get text from element"

3

get text inside element javascript

// get the text inside an element
const text = element.innerText;

// get the html content inside an element
const html = element.innerHTML;
Posted by: Guest on May-30-2021
1

javascript get text from paragraph

function getContent() {
    return document.getElementById("myParagraph").innerHTML;
}
Posted by: Guest on November-14-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language