May 6, 2013

Using Variables in JavaScript

Coding

<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:

Post a Comment

Popular Posts

Views