How to write text in the <body> HTML tag with JavaScript

1 Answer

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

<script>
 
document.body.innerHTML = "text in the body area";

/*
run:
  
you will see "text in the body area" in <body> tag
  
*/

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

 



answered Jul 10, 2015 by avibootz

Related questions

1 answer 483 views
1 answer 287 views
2 answers 7,141 views
2 answers 408 views
2 answers 401 views
...