Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get contents between tags javascript

// Using ES2015+ fat-arrow-function syntax
const getTextOfElement = () => {
  const element = document.getElementById('elementId'); // Get desired HTML element
  console.log(element.textContent); // Get text of element & display in console 
}
Source by www.daniweb.com #
 
PREVIOUS NEXT
Tagged: #contents #tags #javascript
ADD COMMENT
Topic
Name
2+3 =