Displaying text in the browser
Back to Javascript
To display 'Hello World!' in the browser using JavaScript. Notice you can use html within document.write which in this example is making the text bold.
<html>
<body>
<script type="text/javascript">
document.write("<b>Hello World!</b>")
</script>
</body>
</html>