wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

JavaScript Quiz 2

Total questions: 15

Worksheet time: 11mins

Name
Class
Date
1.

This is usually used when you want to make sure that the user reads your message such as warning or a greeting.

a)

Alert Box

b)

User Input Prompt Box

c)

Confirm Box

d)

Warning Box

2.

This is usually used when you want your data to be prompted first before the user can enter a page.

a)

Alert Box

b)

User Input Prompt Box

c)

Confirm Box

d)

Warning Box

3.

This is usually used when you want the user to verify or accept something.

a)

Alert Box

b)

User Input Prompt Box

c)

Confirm Box

d)

Warning Box

4.

These are actions that are triggered either by mouse click, function calls, keyboard strokes, loading of images, submitting an HTML form, etc.

a)

Events

b)

Pop Up Boxes

c)

Functions

d)

Actions

5.

Which of the following attributes happens when the loading of an event is interrupted.

a)

onabort

b)

onblur

c)

onclick

d)

onchange

6.

These attributes are often used with the validation of fields in a form.

a)

onsubmit

b)

onload

c)

onchange

d)

onclick

7.

This is usually used to connect you to another webpage or to trigger an event call.

a)

onclick

b)

onchange

c)

onsubmit

d)

onlaod

8.

These are the windows that pop-out on your screen. This could be before a page is fully loaded, effect of an event on page or before leaving a page.

a)

Popup boxes

b)

Alert boxes

c)

Warning boxes

d)

Dialog boxes

9.

Which of the following is the correct syntax to display "Welcome" in an alert box using JavaScript?

a)

alert-box("Welcome");

b)

msgbox("Welcome");

c)

confirm("Welcome");

d)

alert("Welcome");

10.

To insert a JavaScript into an HTML page, use the _________ tag.

a)

<java>

b)

<script>

c)

<jvcrb>

d)

<jscript>

11.

JavaScript files have the file extension _______.

a)

.jsc

b)

.js

c)

.scj

d)

.html

12.

To display line breaks in the JavaScript syntax, what character will be used?

a)

/

b)

\

c)

}

d)

{

13.

Choose the correct JavaScript mouse event

a)


inmouseover

b)

enmouseover

c)


andmouseover

d)

onmouseover

14.

These events are triggered when a user enters or exits a webpage.

a)

onlaod and onunload

b)

onfocus and onblur

c)

onsubmit and onclick

d)

onmouseover and onmouseout

15.

These attributes are usually for animation purposes. For example, a button or link in a webpage. When the mouse id over it, it will display a different image, however, when you remove the mouse, the button is set back to what it was.

a)

onmouseover and onmouseout

b)

onsubmit and onclick

c)

onblur and onchange

d)

onload and onunload