mirror of
https://github.com/gooba42/adventureland.git
synced 2026-10-15 10:49:27 -05:00
19 lines
620 B
HTML
19 lines
620 B
HTML
<p>Using Javascript is as simple as:</p>
|
|
|
|
<div class='code trimnl executeb'>
|
|
a=5;
|
|
b=7;
|
|
c=a*b;
|
|
alert(c);
|
|
</div>
|
|
|
|
<p>As you probably guessed, we used Javascript like a Calculator, the above program alerts "35".</p>
|
|
|
|
<p>Some more explanation:</p>
|
|
|
|
<div class='code'>
|
|
a=5; // "a" is now a variable that holds the value 5
|
|
b=7; // "b" is now a variable that holds the value 7
|
|
c=a*b; // "c" is a new variable, it's calculated as 5x7 - it's equal to 35, it's the value it's holding now
|
|
alert(c); // "alert" is a function that makes the browser pop up whatever you put in there, annoyingly, you probably saw them before :)
|
|
</div> |