wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

OH MY ECMA

Total questions: 44

Worksheet time: 23mins

Name
Class
Date
1.

JavaScript is ______ language.

a)

Scripting

b)

Programming

c)

Both a and b

d)

Application

2.

JavaScript is ______ Side scripting language.

a)

Server

b)

Client

c)

ISP

d)

Browser

3.

The behaviour of the document elements can be defined by

a)

Using document object

b)

Registering appropriate event handlers

c)

Using element object

d)

All of the mentioned

4.

The service(s) that enables networking through scripted HTTP requests is

a)

XMLHttpResponse

b)

XMLRequest

c)

XMLHttpRequest

d)

All of the mentioned

5.

The HTML5 specification includes

a)

Data storage

b)

Graphics APIs

c)

Other APIs for web apps

d)

All of the mentioned

6.

JavaScript code between a pair of “script” tags are called

a)

Non-inline

b)

External

c)

Referenced

d)

Inline

7.

Client-side JavaScript code is embedded within HTML documents in

a)

A URL that uses the special javascript:encoding

b)

A URL that uses the special javascript:stack

c)

A URL that uses the special javascript:protocol

d)

A URL that uses the special javascript:code

8.

What is the programming philosophy that argues that content and behaviour should as much as possible be kept separate?

a)

Unobtrusive JavaScript

b)

Obtrusive JavaScript

c)

Inherited JavaScript

d)

Modular JavaScript

9.

Which of the following communicates with server-side CGI

scripts through HTML form submissions and can be written without the use

of JavaScript?

a)

Static Web Pages

b)

Interactive Web Pages

c)

Conditional Web Pages

d)

None of the mentioned

10.

______ tag is an extension to HTML that can enclose any number of JavaScript statements.

a)

<SCRIPT>

b)

<BODY>

c)

<HEAD>

d)

<TITLE>

11.

How does JavaScript store dates in a date object?

a)

The number of milliseconds since January 1st, 1970

b)

The number of days since January 1st, 1900

c)

The number of seconds since Netscape's public stock offering.

d)

None of the above

12.

Which of the following attribute can hold the JavaScript version?

a)

LANGUAGE

b)

SCRIPT

c)

VERSION

d)

None Of The Above

13.

What is the correct JavaScript syntax to write "Hello World"?

a)

System.out.println("Hello World")

b)

println ("Hello World")

c)

document.write("Hello World")

d)

response.write("Hello World")

14.

Inside which HTML element do we put the JavaScript?

a)

<js>

b)

<scripting>

c)

<script>

d)

<javascript>

15.

What is the correct syntax for referring to an external script called " abc.js"?

a)

<script href=" abc.js">

b)

<script name=" abc.js">

c)

<script src=" abc.js">

d)

None of the above

16.

Which types of image maps can be used with JavaScript?

a)

Server-side image maps

b)

Client-side image maps

c)

Server-side image maps and Client-side image maps

d)

None of the above

17.

Which is the correct way to write a JavaScript array?

a)

var txt = new Array(1:"tim",2:"kim",3:"jim")

b)

var txt = new Array:1=("tim")2=("kim")3=("jim")

c)

var txt = new Array("tim","kim","jim")

d)

var txt = new Array="tim","kim","jim"

18.

What does the <noscript> tag do?

a)

Enclose text to be displayed by non-JavaScript browsers.

b)

Prevents scripts on the page from executing.

c)

Describes certain low-budget movies.

d)

None of the above

19.

If para1 is the DOM object for a paragraph, what is the correct syntax to change the text within the paragraph?

a)

"New Text"?

b)

para1.value="New Text";

c)

para1.firstChild.nodeValue= "New Text";

d)

para1.nodeValue="New Text";

20.

JavaScript entities start with _______ and end with _________.

a)

Semicolon, colon

b)

Semicolon, Ampersand

c)

Ampersand, colon

d)

Ampersand, semicolon

21.

Which of the following best describes JavaScript?

a)

a low-level programming language.

b)

a scripting language precompiled in the browser.

c)

a compiled scripting language.

d)

an object-oriented scripting language.

22.

Choose the server-side JavaScript object?

a)

FileUpLoad

b)

Function

c)

File

d)

Date

23.

Choose the client-side JavaScript object?

a)

Database

b)

Cursor

c)

Client

d)

FileUpLoad

24.

Which of the following is not considered a JavaScript operator?

a)

new

b)

this

c)

delete

d)

typeof

25.

______method evaluates a string of JavaScript code in the context of the specified object.

a)

Eval

b)

ParseInt

c)

ParseFloat

d)

Efloat

26.

Which of the following event fires when the form element

loses the focus: <button>, <input>, <label>,

<select>, <textarea>?

a)

onfocus

b)

onblur

c)

onclick

d)

ondblclick

27.

JavaScript is interpreted by ______.

a)

Client

b)

Server

c)

Object

d)

None of the above

28.

Using _______ statement is how you test for a specific condition.

a)

Select

b)

If

c)

Switch

d)

For

29.

How to create a Date object in JavaScript?

a)

dateObjectName = new Date([parameters])

b)

dateObjectName.new Date([parameters])

c)

dateObjectName := new Date([parameters])

d)

dateObjectName Date([parameters])

30.

To set up the window to capture all Click events, we use which of the following statement?

a)

window.captureEvents(Event.CLICK);

b)

window.handleEvents (Event.CLICK);

c)

window.routeEvents(Event.CLICK );

d)

window.raiseEvents(Event.CLICK );

31.

How does one detach an event listener added to a html element?

a)

element.detachEventListener("event",callback)

b)

element.deleteEventListener("event",callback)

c)

element.removeEventListener("event",callback)

d)

element.addEventListener("event",null)

32.

What is the storage data type of localStorage/sessionStorage?

a)

JSON

b)

String

c)

Array

d)

Heap

33.

Which of the following is not a available methods of localStorage/sessionStorage?

a)

addItem(key,value)

b)

setItem(key,value)

c)

getItem(key,value)

d)

clear()

34.

Which is not on of the types of Pop up boxes available in JavaScript?

a)

Prompt

b)

Alert

c)

Confirm

d)

Dialog

35.

Which of these tags don't go in the head tag in html?

a)

marquee

b)

link

c)

script

d)

meta

36.

______ JavaScript is also called client-side JavaScript.

a)

Microsoft

b)

Navigator

c)

LiveWire

d)

Native

37.

Which of the following are capabilities of functions in JavaScript?

a)

Return a value

b)

Accept parameters and Return a value

c)

Accept parameters

d)

None of the above

38.

The JavaScript exception is available to the Java code as an instance of __________

a)

netscape.javascript.JSObject

b)

netscape.javascript.JSException

c)

netscape.plugin.JSException

d)

None of the above

39.

The _______ method of an Array object adds and/or removes elements from an array.

a)

Reverse

b)

Shift

c)

Slice

d)

Splice

40.

Which of the following event fires when the form element loses the focus: <button>, <input>, <label>, <select>, <textarea>?

a)

onfocus

b)

onblur

c)

onclick

d)

ondblclick

41.

If para1 is the DOM object for a paragraph, what is the correct syntax to change the text within the paragraph?

a)

"New Text"?

b)

para1.value="New Text";

c)

para1.firstChild.nodeValue= "New Text";

d)

para1.nodeValue="New Text";

42.

Predict the output of the following JavaScript code.

<script type="text/javascript" language="javascript">

var x=5;

var y=6;

var res=eval("x*y");

document.write(res);

</script>

a)

“30”

b)

30

c)

5*6

d)

“5*6”

43.

Which of the following is not a reserved word in JavaScript?

a)

interface

b)

throws

c)

program

d)

short

44.

Numeric array values can be sorted through an array method named as

a)

sort()

b)

length.sort()

c)

reverse()

d)

compare()