JavaScript variable

04:56 0 Comments A+ a-

<html>
<body>

<script type="text/javascript">
var firstname;
firstname="Munirul";
document.write(firstname);
document.write("<br />");
firstname="Hasan";
document.write(firstname);
</script>

<p>The script above declares a variable,
assigns a value to it, displays the value, changes the value,
and displays the value again.</p>

</body>
</html>

Result