NEW
Font size
WorksheetsCode.Org JavaScript
Total questions: 30
Worksheet time: 17mins
y = 3;
x = 5 * y;
x++;
var xPos = 15;
var yPos = 350;
var xwidth = 50;
var ywidth = 50;
draw = function() {
background(29, 40, 115);
fill(255, 242, 0);
ellipse(xPos, yPos, xwidth, ywidth); xPos++;
yPos--;
xwidth = xwidth* 99/100;
ywidth = ywidth * 99/100;
};
This script will show as a result:
<html>
<head> <script>
alert("Hello World !");
</script></head>
<body>
</body>
</html>
Hello World !
Hello
Hello World
World !
To use an external script, put the name of the script file in the src (source)
attribute of the ___________ tag:
<java>
<scr>
<script>
<html>
Complete the gaps: In a programming language, variables are used to store data values. JavaScript uses the ____1____ keyword to define variables.
JavaScript ____2_____ can hold ___3____ like 100, and ___4___ (text) values like "Henri Tusku".
1.variables , 2.var , 3.numbers , 4.string
1.string , 2.numbers , 3.var , 4.variables
1.var, 2.variables , 3.numbers , 4.string
1.string , 2.numbers , 3.var , 4.var
_______________________________can contain letters, digits, underscores, and dollar signs (same rules as variables).
Variables
Java Script
Code
Function names
