How to display the HTML in the <body> tag with JavaScript

1 Answer

0 votes
<!DOCTYPE html>
<html>
  
<head></head>
  
<body>

text in the body area

<p>text in p tag</p>

<script>
 
alert(document.body.innerHTML);

/*
run:
  
you will see the body HTML
  
*/

</script>
</body>
  
</html>

 



answered Jul 10, 2015 by avibootz

Related questions

1 answer 328 views
1 answer 293 views
2 answers 7,153 views
2 answers 430 views
2 answers 418 views
...