Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

inner text and inner html

<body>
  <div id="app">
    <div>First Content</div>
    <div>Second Content</div>
  </div>
  
  <script>
    const app = document.getElementById('app');
    
    console.log(app.innerText);
//output:
// =>  First Content
// =>  Second Content
    
    console.log(app.innerHtml);
//output:
// =>  <div id="app">
// =>    <div>First Content</div>
// =>    <div>Second Content</div>
// =>  </div>
  </script>
</body>
 
PREVIOUS NEXT
Tagged: #text #html
ADD COMMENT
Topic
Name
3+5 =