Search
 
SCRIPT & CODE EXAMPLE
 

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>
Comment

PREVIOUS NEXT
Code Example
Html :: custom checkbox with image css 
Html :: tailwind ul list type 
Html :: tailwind css text wrap 
Html :: meta tag tester 
Html :: html ascii for space 
Html :: how to center a text html 
Html :: Prettier not formatting HTML files in VS Code 
Html :: mailto like call 
Html :: style tag html 
Html :: html prevent focus on input 
Html :: row span 
Html :: html change background color of page 
Html :: how to make element bold in bootstrap 4 
Html :: html5 audio tag style 
Html :: bootstrap error message 
Html :: table column width 
Html :: how to change font color of h2 tag in html 
Html :: how to use js in html 
Html :: android strings plural 
Html :: html figure 
Html :: class required bootstrap 3 
Html :: upload button in html 
Html :: html faq 
Html :: table bootstrap with scrool 
Html :: html tags 
Html :: relative vs absolute path html 
Html :: stimulus value 
Html :: how to keep :active css style after click a button 
Html :: bootstrap 5 font color 
Html :: opening tag closing tag 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =