NEW
Font size
WorksheetsSnake Game
Total questions: 15
Worksheet time: 15mins
Choose the correct JavaScript syntax to change the content of the following HTML code.
<p id="geek">GeeksforGeeks</p>
document.getElementById(“geek”).innerHTML=”I am a Geek”;
document.getElement(“geek”).innerHTML=”I am a Geek”;
None of the above
Which of the following is the correct syntax to display “GeeksforGeeks” in an alert box using JavaScript?
alert(“GeeksforGeeks”);;
alert(“GeeksforGeeks”);
None of the above
The latest versions of Firefox, Safari, Chrome and Opera all do not support HTML5 Canvas.
True
False
The fillRect() method of the HTML canvas is used to create a filled rectangle on the _____.
msg(“Hello world”)
Target=”new”
web page
How to Write JS Comments?
// this is a comment //
<-- this is a comment -->
<!--this is a comment -->.
The stroke() method actually draws the path you have defined with all those moveTo() and lineTo() methods..
True
False
Which function is used to draw the arc on canvas?
fun function
<th>
Stroke()
The canvas drawImage() function allows you to add?
Images
pixels
None of the above
How does a WHILE loop start?
while(i <= 10)
loop: start();
None of the above
_____________ objects describe a user interaction with the keyboard
KeyboardEvent
legend
action
What does Strokerect() create?
polygon
Squrae
rectangle
Which property sets or returns the color, gradient, or pattern used to fill the drawing.?
elements
Fillstyle()
None of the Above
Which method moves the path to the specified point in the canvas?
Moveto()
Moveahead()
Movetoright()
The canvas element has a DOM method it is called.?
getContext
GET
Request
To draw text on a canvas, which property and method is used.?
stokeText(text,x,y, z)
stokeText(text,x,y)
None of the above
