Time to get our hands dirty!




Lets learn about document.write()


This command is used to add static elements into the HTML (It only works when the document is drawn and no more), a very simple command. It can be used to display outputs from the DOM and programming calculations performed using Javascript

Lets use this to access some DOMs...

<script type="text/javascript">

document.write("Browser appname: " + window.navigator.appName + "<br><br>")

</script>


<script type="text/javascript">

document.write("Browser version: " + window.navigator.appVersion + "<br><br>")

</script>

This can be used to determine which browser you are using and tailor content according to its abilities


Browser properties example

Page6