wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

INT219

Total questions: 127

Worksheet time: 1hrs 3mins

Name
Class
Date
1.

JS Function is a block of code designed to perform a particular task.?

a)

False

b)

True

2.

What does an JS Events do?

a)

Event handlers can be used to handle, and verify, user input, user actions, and browser actions.

b)

Do a event

c)

None of the above

3.

Which function among the following lets to register a function to be invoked once?

a)

setTimeout()

b)

setTotaltime()

c)

setInterval()

d)

settime()

4.

How is everything treated in HTML DOM?

a)

Node

b)

Attributes

c)

Elements

d)

Arrays

5.

Which object is the top of the hierarchy?

a)

Window Object

b)

Document Object

c)

Form Object

d)

Form Control Elements

6.

What among the following is an appropriate event handler for input text among the below options ?

a)

onclick

b)

onchange

c)

onkeyup

d)

onblur

7.

How are the objects organized in the HTML DOM?

a)

Class-wise

b)

Queue

c)

Hierarchy

d)

Stack

8.

Consider the below code:

Identify the correct code in order to fetch the value entered in username text field?

< body>

< form name="register">

Enter username < input value="John" id="name" name="username">

< /form>

< /body>

a)

document.register.name.value

b)

document.getElementById ("name").value

c)

document.getElementByName ("name").value

d)

None of the above

9.

The paragraph P Tag is a part of_______

a)

<body>

b)

<html>

c)

<h1>

d)

both <body> <html>

10.

The node directly above a node is called

a)

sibling

b)

child

c)

parent

d)

ancestral

11.

The node that represent html elements

a)

subclassesnodes

b)

windownodes

c)

htmlnodes

d)

elementnodes

12.

In general, event handler is nothing but ____________

a)

function

b)

interface

c)

event

d)

handler

13.

Which syntax is used to describe elements in CSS?

a)

Protectors

b)

Selectors

c)

Both Protectors and Selectors

d)

Protectors or Selectors

14.

Which is the correct way to write a JavaScript array?

a)

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

b)

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

c)

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

d)

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

15.

How can you add a comment in a JavaScript?

a)

//This is comment

b)

'This is comment

c)

<!-- This is comment-->

16.

Which of the following JavaScript methods are you most likely to use to activate a button?

a)

onmouseover

b)

onload

c)

whenclick

d)

onclick

17.

What DOM Property is used to update the text of an HTML tag?

a)

id

b)

innerHTML

c)

src

d)

style

18.

What is one key characteristic of an id?

a)

It must be capitalized

b)

It must be unique to one tag

c)

It cannot include numbers

d)

It must go in the closing tag

19.

Which of the following is the proper way to call the testFunction() function when a button is clicked? 

a)

onclick=testFunction

b)

when button clicked = "testFunction()"

c)

onclick="testFunction()"

d)

onclick="testFunction"

20.

<button onclick="aFunction()"> Click me </button>


What is output once the button is pressed?

a)

aFunction() is called and its code get executed / aFunction () est appelée et son code est exécuté

b)

Click me is displayed / Cliquez sur moi s'affiche

21.

What do "purple", "green" in this code refer to?


var x1= document.getElementById("purple")

var x2= document.getElementById("green")

a)

They are the IDs / Ce sont les ID

b)

They are the names of the HTML / Ce sont les noms du HTML

c)

They are the names of <h1> tags / Ce sont les noms des balises <h1>

d)

They are the names of <p> tags / Ce sont les noms des balises <p>

22.

Which of the following method checks if its argument is not a number?

a)

isNaN()

b)

nonNaN()

c)

NaN()

d)

None of the above

23.

Which of the following is not JavaScript Data Types?

a)

Undefined

b)

Number

c)

Boolean

d)

Float

24.

What are the types of Pop up boxes available in JavaScript?

a)

Alert

b)

Prompt

c)

Confirm

d)

All of the above

25.

What is divide by 0 in Javascript? var a = 10;

var b = 0;

document.write(a/b);

a)

Nothing is printed

b)

0 is printed

c)

Infinity is printed

d)

Some Garbage Value

26.

Does JavaScript allow exception handling?

a)

A. Yes, it provides try, catch as well as throw key word for exception handling

b)

Yes, but it provides only try block

c)

Yes, but it provides only Try catch block, but does not allow throw exception

d)

No

27.
To display writing on the screen you must include this direction;
a)
Document Write
b)
documentWrite
c)
document.write( )
d)
document.write
28.
A string;
a)
Expresses a true false statement
b)
can contain letters, numbers, spaces, and symbols.
c)
takes in an input, does something with it, and then returns an output.
d)
Runs a boolean (true/false) statement based on data entered
29.
What surrounds a string?
a)
Quotations
b)
Curly Brackets
c)
Parenthesis
d)
Square Brackets
30.
To display writing on the screen you must include this direction;
a)
Document Write
b)
documentWrite
c)
document.write( )
d)
document.write
31.
A variable;
a)
Expresses a true false statement
b)
stores a string, number, or boolean, and gives it a specific, case-sensitive name
c)
takes in an input, does something with it, and then returns an output.
d)
Runs a boolean (true/false) statement based on data entered
32.
A boolean;
a)
Expresses a true false statement
b)
can contain letters, numbers, spaces, and symbols.
c)
takes in an input, does something with it, and then returns an output.
d)
Runs a boolean (true/false) statement based on data entered
33.
A function;
a)
Expresses a true false statement
b)
can contain letters, numbers, spaces, and symbols.
c)
takes in an input, does something with it, and then returns an output.
d)
Runs a boolean (true/false) statement based on data entered
34.
An if/else statement;
a)
Expresses a true false statement
b)
can contain letters, numbers, spaces, and symbols.
c)
takes in an input, does something with it, and then returns an output.
d)
Runs a boolean (true/false) statement based on data entered
35.
What surrounds an if/else statement?
a)
Quotations
b)
Curly Brackets
c)
Parenthesis
d)
Square Brackets
36.
An array is;
a)
Shapes
b)
Sizes
c)
Options
d)
Lists of data
37.
What surrounds an array?
a)
Quotations
b)
Curly Brackets
c)
Parenthesis
d)
Square Brackets
38.

JavaScript is ______ Side Scripting Language.

a)

JSP

b)

Servlet

c)

Server

d)

Browser

39.

JavaScript is designed for following purpose -

a)

To Style HTML Pages

b)

To Perform Server Side Scripting Opertion

c)

To add interactivity to HTML Pages.

d)

To Execute Query Related to DB on Server

40.

JavaScript is can be written -

a)

directly into JS file and included into HTML

b)

directly into HTML pages

c)

directly on the Server Script

d)

None of these

41.

JavaScript is an ________ language.

a)

compiled

b)

interpreted

42.

JavaScript Code is written inside file having extension __________.

a)

.jsc

b)

.jvs

c)

.js

d)

.javascript

43.

Is this correct syntax to include JS Code inside HTML Page ?

<script type="text/javascript">

...

</script>

a)

Yes

b)

No

44.

We cannot Place JS Code in the body tag . Say true/false.

a)

True

b)

False.

45.

These are any variable names listed within a function's argument definition.


example: myFunction(x, y)

a)

Parameter

b)

Literals

c)

Constraints

d)

Variables

46.

Which of the Tag Pair is used to enable JS script writing in HTML?

a)

<br>

b)

<script>

c)

<JS>

d)

<code>

47.

Which funtion is used when a JS application must ensure that the user gets the information that is displayed?

a)

Alert box

b)

Prompt Box

c)

Combo Box

d)

Confirm Box

48.

Conditions return values of which data type?

a)

Integer

b)

boolean

c)

floating-point

d)

string

49.

file extension for external JS files

a)

.javascript

b)

.js

c)

.jscript

d)

.script

50.

used to write comments

a)

++

b)

=

c)

//

d)

--

51.

What CSS Selectors selects HTML elements based on the element name?

a)

CSS Class selector

b)

CSS Element Selector

c)

CSS ID Selector

d)

None of the above

52.

What CSS Selectors that is written with hash (#) character?

a)

CSS Class selector

b)

CSS Element Selector

c)

CSS Universal Selector

d)

None of the above

53.

What method of CSS, that includes a reference a style sheet file inside a link.

a)

Inline CSS

b)

External CSS

c)

Internal CSS

d)

None of the above

54.

In-line Styling: Change the color of the text

a)

<p style:"color:blue">

b)

<p style:"color:blue">

c)

<p style="color:blue">

d)

<p style="color=blue">

55.

Where can we find what the stylesheet is called?

a)

<link href="styles.css"> in the <head> tag

b)

styles=styles.css

c)

I have no idea

d)

In the <body> tag

56.

Bolded text tag?

a)

<dark> </dark>

b)

<bold> </bold>

c)

<strong> </strong>

d)

<heavy> </heavy>

57.

CSS: How to change the background color of a paragraph or header?

a)

background color: blue;

b)

background-color: blue;

c)

color: blue;

d)

back-color: blue;

58.

CSS: How to change the text color?

a)

txt-color: red;

b)

text color: red;

c)

text-color: red;

d)

color: red;

59.

CSS: How to change the font of the text?

a)

text-font: Calibri;

b)

font: Calibri;

c)

font-family: Calibri;

d)

text font: Calibri;

60.

Which selector will change the font of the text?

a)

font-size

b)

text-align

c)

font-famiy

d)

text-decoration

61.

Which rule set would change the font size to 24?

a)

font-size: 24

b)

size: 24;

c)

font-size: 24;

d)

font size: 24;

62.

Which type of CSS is used in the below code?

<p style = "border:2px solid red;">

a)

Inline CSS

b)

Internal CSS

c)

External CSS

d)

None of the above

63.

Which property is used in CSS to change the background color?

a)

bgcolor:

b)

background-color:

c)

color:

d)

back-color:

64.

Where in an HTML document is the correct place to refer to an external style sheet?

a)

In the <head> section

b)

At the top of the document

c)

in the <body> section

d)

At the end of the document

65.

If we want define style for an unique element, then which css selector will we use ?

a)

id

b)

class

c)

element

d)

group

66.

In CSS how to select the elements with the class name "example"?

a)

example

b)

#example

c)

.example

d)

Class example

67.

What is the correct syntax to change the background color with css?

a)

background-color: purple;

b)

background-color = "purple";

c)

backgroundcolor=orange

d)

change-background-color: purple

68.

What is missing from this HTML skeleton?


<!DOCTYPE html>

<html>

<body>

</body>

</html>

a)

<head></head>

b)

<div></div>

c)

<img></img>

d)

<head>

69.

How do you change the font color with CSS?

a)

font-color: green;

b)

color: green;

c)

change-font-color: green;

d)

fontcolor=green;

70.

Which of the following is the correct CSS link tag?

a)

<link rel="styles" href="stylesheet.css">

b)

<link href="stylesheet">

c)

<link rel="stylesheet" src="styles.css">

d)

<link rel="stylesheet" href="styles.css">

71.
What is the proper code to insert an image named "frog.jpg"?
a)
<img src="frog" width="104" height="142">
b)
<img="frog.jpg" width="104" height="142">
c)
<img src="frog.jpg" width="104" height="142">
d)
<img ="frog" width="104" height"142">
72.

Which is the correct CSS syntax?

a)

body {color: yellow;}

b)

body:color=yellow;

c)

{body:color= yellow;}

d)

{body;color: yellow;}

73.

Which one is the correct syntax for CSS?

a)

property {selector : value}

b)

value {property : selector}

c)

selector {value : property}

d)

selector { property : value}

74.

What is the proper CSS format for background color?

a)

back-ground color:orange:

b)

backgroundcolor-orange;

c)

background:color:orange;

d)

background-color:orange;

75.

What HTML code is used to center the words on the page when the coding starts on the left margin?

a)

right-align;

b)

<center></center>

c)

left-align;

d)

<middle></middle>

76.

What is the correct code for a paragraph in CSS?

a)

P

b)

<p> </p>

c)

.p

d)

p{

}

77.
What symbols go around the properties for each CSS selector?
a)
< >
b)
[ ]
c)
{ }
d)
( )
78.
Which is the selector for a link?
a)
a { }
b)
link { }
c)
href { }
d)
a href { }
79.

The blue is called an _____________

a)

Declaration

b)

Selector

c)

Property

d)

Value

80.

The blue is called an _____________

a)

Declaration

b)

Selector

c)

Property

d)

Value

81.

The blue is called an _____________

a)

Declaration

b)

Selector

c)

Property

d)

Value

82.

Which is the value in the CSS code below?

h1 {border: 29px solid red}

a)

h1

b)

border

c)

29px solid red

d)

{ }

83.
If you want to have more than one property for a CSS selector, what character separates them?
a)
comma (,)
b)
semi-colon (;)
c)
colon (:)
d)
dash (-)
84.
Select the code below that uses CSS to configure a background color of #000000 for a web page.
a)
body { background-color: #000000; }
b)
body { bgcolor: #000000; }
c)
document { background­-page: #000000; }
d)
None of these
85.
Which is the correct way to format a Font Family for a paragraph?
a)
p { font-face: Arial; }
b)
p { family-font: Arial; }
c)
p { font-family: Arial; }
d)
p { font: Arial; }
86.
Which CSS code centers text?
a)
p {align: center;}
b)
p {text-align: center;}
c)
p {align=center;}
d)
p {center;}
87.
What property changes the border for an image/table?
a)
border:
b)
border-size:
c)
border-color:
88.

To create a dotted border around the page

a)

border-style

b)

border-width

c)

border-color

d)

width

89.

Change the border size of the body or image

a)

border-style

b)

border-width

c)

border-color

d)

width

90.

sets the color of words in a paragraph

a)

h1 {

color: pink;

}

b)

img {

color: pink;

}

c)

body {

color: pink;

}

d)

p {

color: pink;

}

91.

What does a class do?

a)

adds color to words

b)

adds style to specific elements

c)

adds style to a whole page

d)

adds a lot more work

92.

Select the rule set to make all the text in your web page blue and centered.

a)

p {

color: blue;

}

b)

body {

text-align: left;

color: blue;

}

c)

p {

text-align: center;

color: blue;

}

d)

body {

text-align: center;

color: blue;

}

93.

Which rule set would change the font size to 24?

a)

font-size: 24

b)

size: 24;

c)

font-size: 24;

d)

font size: 24;

94.
What is the proper code to insert an image named "frog.jpg"?
a)
<img src="frog" width="104" height="142">
b)
<img="frog.jpg" width="104" height="142">
c)
<img src="frog.jpg" width="104" height="142">
d)
<img ="frog" width="104" height"142">
95.

What type of tag is this: <!-- -->

a)

comments

b)

questions

c)

paragraph

d)

image

96.

<h1> is an example of a _______.

a)

Headline Tag

b)

Paragraph Tag

c)

filename

97.

<p> is a _______ tag.

a)

image

b)

paragraph

c)

filename

98.

What does a opening tag look like?

a)

< >

b)

</ >

c)

<< >>

d)

<

99.

What does a closing tag look like?

a)

< >

b)

<\ >

c)

</ >

d)

<< >>

100.

What should a HTML web page start with?

a)

<b>

b)

<li>

c)

<html>

d)

<start>

101.

What should a HTML web page end with?

a)

</html>

b)

<head>

c)

</end>

d)

</body>

102.

What is the difference between <h1> and <h2>?

a)

<h1> is larger in size than <h2>

b)

<h2> is larger in size than <h1>

c)

both are the same size but different headings

d)

none of the above

103.
Which of the following is the largest heading? 
a)
H2
b)
H3
c)
H4
d)
H6
104.

Which is the proper way to write an h1 tag

a)

<h1>Hello</h1>

b)

<h1>"Hello

c)

{h1}Hello{/h1}

d)

<h1>Hello<h1>

105.
What is will the highlighted tag do? <p>My favourite colour is blue<br>I support Southend United.
</p>
a)
it will make the text bold
b)
it will place the text on another line
106.
CSS stands for?
a)
Closed Source Style
b)
Crucial Style Sheets
c)
Cascading Style Sheets
d)
Corresponding Static Style
107.

What will this code display?

a)

8, 2, 1, 4, 7

b)

82147

c)

Myarray.length

d)

5

108.

What will this code display?

a)

Hello Emma

b)

Hello user

c)

Hello+user

d)

nothing

109.

What will this code display?

a)

570

b)

569

c)

568

d)

attendees

110.

What would this piece of code do?

a)

change the background color of the word demo to red

b)

change the font color of the demo element to red

c)

this is not correct

d)

styles the element with the class demo

111.

Which of these is a method?

a)

getElementById( )

b)

style

c)

document

d)

color

112.

Correct this code so that

Hello!

is displayed in the paragraph

with the id "demo"

a)

add

.style.text

after ("demo")

b)

add

.innerHTML

after ("demo")

c)

add a semi colon after myFunction()

d)

Save "Hello" in a variable first

113.

The Document Object Model (DOM) can be used to:

a)

Find elements by class

b)

Create new elements

c)

Retrieve data from a server

d)

Change element styles

114.

Float property works in which way?

a)

Top

Left

Bottom

Right

b)

Left

Right

c)

Top

Bottom

d)

Left

Bottom

Right

115.

The output of the below code is:


<p id="demo"></p>


<script>

var text = "";

var i;

for (i = 0; i < 5; i++) {

text += "The number is " + i + "<br>";

}

document.getElementById("demo").innerHTML = text;

</script>

a)

The number is 0

The number is 1

The number is 2

The number is 3

The number is 4

The number is 5

b)

The number is 0

The number is 1

The number is 2

The number is 3

The number is 4

c)

The number is 1

The number is 2

The number is 3

The number is 4

The number is 5

d)

Why is that person using "var"???

116.

What is the difference between == and ===?

a)

The === operator compares two values, without taking into account their types. == compares the values, but also makes their types into account.

b)

Do I really need to reply this?

c)

The == operator compares two values, without taking into account their types. === compares the values, but also makes their types into account.

d)

The == operator is used to assign a value to a variable. === is used to compare the values of two variables.

117.

What is the DOM?

a)

Is an open standard file format, and data interchange format, that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and array data types

b)

Is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaScript

c)

Is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable

d)

The Document Object Model is a cross-platform and language-independent interface that treats an XML or HTML document as a tree structure wherein each node is an object representing a part of the document

118.

What are HTML Tags?

a)

HTML tags are composed of three things: an opening tag, content and ending tag. Some tags are unclosed tags.

b)

HTML tags are composed of three things: an opening tag, content and ending tag. All tags need to be closed.

c)

HTML tags define metadata about an HTML document. Metadata is data (information) about data.

d)

I didn't know that I was supposed to be studying

119.

Select the correct option:

a)

The getElementsByName() method returns a live HTMLCollection of elements with the given tag name.

The getElementsByTagName() method returns a collection of all elements in the document with the specified name (the value of the name attribute), as an HTMLCollection object.

b)

The innerHTML property sets or returns the text content of the specified node, and all its descendants.

The innerText property sets or returns the HTML content of an element.

c)

let allows you to declare variables that are limited to the scope of a block statement, or expression on which it is used, unlike the var keyword, which declares a variable globally, or locally to an entire function regardless of block scope

d)

The difference between POST and PUT is that POST requests are idempotent. That is, calling the same POST request multiple times will always produce the same result. In contrast, calling a PUT request repeatedly have side effects of creating the same resource multiple times.

120.

Identify the name of the object in the following code:


var car = { model: "EXPLORER", brand: "Ford", IntroductionYear: 2019 }

a)

car

b)

"EXPLORER"

c)

model

d)

var

121.

Identify a key in the following code:


var car = { model: "EXPLORER", brand: "Ford", IntroductionYear: 2019 }

a)

car

b)

"EXPLORER"

c)

model

d)

var

122.

Identify a value in the following code:


var car = { model: "EXPLORER", brand: "Ford", IntroductionYear: 2019 }

a)

car

b)

"EXPLORER"

c)

model

d)

var

123.

What is DRIVE in the code below?


var car = {

DRIVE: function()

alert("Drive");

}

a)

A property

b)

A method

c)

A variable

d)

A function

124.

What is the code that allows you to make use DRIVE?


var car = {

DRIVE: function()

alert("Drive");

}

a)

drive()

b)

DRIVE()

c)

car.drive()

d)

car.DRIVE()

125.

sets the color of words in a paragraph

a)

h1 {

color: pink;

}

b)

img {

color: pink;

}

c)

body {

color: pink;

}

d)

p {

color: pink;

}

126.

Select the rule set to make all the text in your web page blue and centered.

a)

p {

color: blue;

}

b)

body {

text-align: left;

color: blue;

}

c)

p {

text-align: center;

color: blue;

}

d)

body {

text-align: center;

color: blue;

}

127.
Where in the HTML document is the correct location to insert code to link to your external CSS? 
a)
In the <head> section
b)
In the <body> section
c)
At the very end of the document
d)
At the very beginning of the document