To show a popup with the result of a calculation.
<html>
<body>
<script>
a = 2
b = 9
c = a + b
alert(c)
</script>
</body>
</html>
Here we have variable manipulation, like the traditional math.
Understanding the code:
a = 2
Makes the
a variable receive number 2.
b = 9
Makes the
b variable receive number 9.
c = a + b
Makes the
c variable receive the result of a + b.
alert(c)
Makes the window to display the content of the
c variable. Note that we don't use quotes before and after c because we want the code to show the value of the variable. If we put quotes, it would only show the letter c, literally.