Monday 16 July 2012

How to Declare a variable, assign a value to it, and display it in javascript


<!DOCTYPE html>
<html>
<body>

<script type="text/javascript">
var firstname;
firstname="Hege";
document.write(firstname);
document.write("<br />");
firstname="Tove";
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>



0 Responses to “How to Declare a variable, assign a value to it, and display it in javascript”

Post a Comment