Agyan
adda
Run
Reset
Copy
JavaScript Tutorial › JS Output › Different output methods
Back to tutorial
Code
Edit, then press Run or Ctrl+Enter
<p id="a"></p> <p id="b"></p> <script> document.getElementById('a').textContent = '<b>textContent</b> shows tags as text'; document.getElementById('b').innerHTML = '<b>innerHTML</b> renders the tags'; console.log('Open the console (F12) to see this message'); </script>
Result