Thursday, September 1, 2011

Example 1. Using Variables in JavaScript    

Example 1. Using Variables in JavaScript    

<html>

<body>

<script language="JavaScript">

var name = "Hege"

document.write(name)

document.write("<h1>"+name+"</h1>")

</script>

<p>This example declares a variable, assigns a value to it, and then displays
the variable.</p>

<p>Then the variable is displayed one more time, only this time as a
heading.</p>

</body>

</html>



 





No comments: