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 317 views
1 answer 287 views
2 answers 7,142 views
2 answers 409 views
2 answers 402 views
...