wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Snake Game

Total questions: 15

Worksheet time: 15mins

Name
Class
Date
1.

Choose the correct JavaScript syntax to change the content of the following HTML code.

<p id="geek">GeeksforGeeks</p>

a)

document.getElementById(“geek”).innerHTML=”I am a Geek”;

b)

document.getElement(“geek”).innerHTML=”I am a Geek”;

c)

None of the above

2.

Which of the following is the correct syntax to display “GeeksforGeeks” in an alert box using JavaScript?

a)

alert(“GeeksforGeeks”);;

b)

alert(“GeeksforGeeks”);

c)

None of the above

3.

The latest versions of Firefox, Safari, Chrome and Opera all do not support HTML5 Canvas.

a)

True

b)

False

4.

The fillRect() method of the HTML canvas is used to create a filled rectangle on the _____.

a)

msg(“Hello world”)

b)

Target=”new”

c)

web page

5.

How to Write JS Comments?

a)

// this is a comment //

b)

<-- this is a comment -->

c)

<!--this is a comment -->.

6.

The stroke() method actually draws the path you have defined with all those moveTo() and lineTo() methods..

a)

True

b)

False

7.

Which function is used to draw the arc on canvas?

a)

fun function

b)

<th>

c)

Stroke()

8.

The canvas drawImage() function allows you to add?

a)

Images

b)

pixels

c)

None of the above

9.

How does a WHILE loop start?

a)

while(i <= 10)

b)

loop: start();

c)

None of the above

10.

_____________ objects describe a user interaction with the keyboard

a)

KeyboardEvent

b)

legend

c)

action

11.

What does Strokerect() create?

a)

polygon

b)

Squrae

c)

rectangle

12.

Which property sets or returns the color, gradient, or pattern used to fill the drawing.?

a)

elements

b)

Fillstyle()

c)

None of the Above

13.

Which method moves the path to the specified point in the canvas?

a)

Moveto()

b)

Moveahead()

c)

Movetoright()

14.

The canvas element has a DOM method it is called.?

a)

getContext

b)

GET

c)

Request

15.

To draw text on a canvas, which property and method is used.?

a)

stokeText(text,x,y, z)

b)

stokeText(text,x,y)

c)

None of the above