wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

HTML CSS JavaScript

Total questions: 56

Worksheet time: 31mins

Name
Class
Date
1.

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"???

2.

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.

3.

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

4.

What is the output of 10+20+"30" in JavaScript?

a)

102030 because since there is a string, all the + will be treated as string concatenation operator (not binary +).

b)

102030 because before you perform arithmetic operations you would have to explicitly convert those values to an actual number.

c)

That will throw an unhandled exception, a try catch block is required to prevent it.

d)

3030 because 10+20 will be 30. If there is numeric value before and after +, it treats as binary + (arithmetic operator).

5.
You should save HTML files with which file extension?
a)
.htm
b)
.index
c)
.webpage
d)
.html
6.
Which of the following is the largest heading? 
a)
h2
b)
h3
c)
h4
d)
h6
7.
Which is the correct way of defining an HTML5 document?
a)
<!DOCTYPE html>
b)
<!DOCTYPE HTML5>
c)
<!DOCTYPE html "PUBLIC">
d)
<DOCTYPE html>
8.
HTML5 incorporates three kinds of code: HTML, CSS and Javascript. Which of these provides the structure to a webpage?
a)
Javascript
b)
HTML
c)
CSS
d)
None
9.
What is an HTML element?
a)
The starting tag
b)
The ending tag
c)
The content between the tags
d)
Everything from start to end tag
10.
Which is the correct HTML element for inserting a line break?
a)
<b>
b)
<lb>
c)
<br>
d)
<break>
11.

Which of these is a loop?

a)

if(x<10)

b)

while(x<10)

c)

var x=10;

d)

text(x,10;10)

12.

Greater than or equal to

a)

> or =

b)

> || =

c)

>=

d)

<=

13.

When we are done with a line what do we put at the end?

a)

a colon :

b)

a semi-colon ;

c)

a period .

d)

a quotation mark "

14.

What is a style sheet?

a)

A style sheet is used to build a consistent, transportable, and well-designed style template.

b)

To create a multicolor text on a web page

c)

It is used to define a container for navigation links

d)

It is used to define content aside from the content

15.

What does a opening tag look like?

a)

< >

b)

</ >

c)

<< >>

d)

<

16.

What does a closing tag look like?

a)

< >

b)

<\ >

c)

</ >

d)

<< >>

17.

What should a HTML web page end with?

a)

</html>

b)

<head>

c)

</end>

d)

</body>

18.

Which tag would you use for an ordered list?

a)

<ol>

b)

<ul>

c)

<li>

d)

None of the above

19.

Which tag would you use to insert a image?

a)

<marquee>

b)

< a href>

c)

<br>

d)

<img src>

20.

Javascript is _________ language.

a)

Programming

b)

Scripting

c)

Application

d)

applet

21.

JavaScript is ______ Side Scripting Language.

a)

JSP

b)

Servlet

c)

Server

d)

Browser

22.

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

23.

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

24.

JavaScript is an ________ language.

a)

compiled

b)

interpreted

25.

JavaScript Code is written inside file having extension __________.

a)

.jsc

b)

.jvs

c)

.js

d)

.javascript

26.

Why JavaScript is called as Lightweight Programming Language ?

a)

because JS can provide programming functionality inside but up to certain extend.

b)

because JS is client side scripting

c)

because JS is available free of cost.

d)

because we can add programming functionality inside JS

27.

Local Browser used for validations on the Web Pages uses __________.

a)

HTML

b)

CSS

c)

js

d)

java

28.

JavaScript Code can be called by using _________.

a)

RMI

b)

Function / Method

c)

Triggering Event

d)

Preprocessor

29.

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

<script type="text/javascript">

...

</script>

a)

Yes

b)

No

30.

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

a)

True

b)

False.

31.

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

<script type="text/javascript">

...

</script>

a)

Yes

b)

No

32.
HTML attributes always appear where?
a)
In the opening tag
b)
In the closing tag
c)
Between the tags
d)
After the closing tag
33.
HTML5 incorporates three kinds of code: HTML, CSS and Javascript. Which of these provides the structure to a webpage?
a)
Javascript
b)
HTML
c)
CSS
d)
None
34.
What is an HTML element?
a)
The starting tag
b)
The ending tag
c)
The content between the tags
d)
Everything from start to end tag
35.

<script type="text/javascript">

x=4+"4";

document.write(x);

</script>

Output------?

a)

44

b)

8

c)

4

d)

Error output

36.
Is JavaScript exactly the same as Java?
a)
No
b)
Yes
37.
Javascript is case-sensitive
a)
True
b)
False
38.
What is CSS used for?
a)
styling web pages
b)
formatting script correctly
c)
client side scripting
d)
server side scripting
39.
Indicates the beginning  and the end of a JavaScript section.
a)
<html> </html>
b)
<style> </style>
c)
<article> </article>
d)
<script> </script>
40.
A JavaScript file has an extension name of
a)
.jscp
b)
.js
c)
.css
d)
.Jp
41.
Which keyword do we need to define a function?
a)
function
b)
method
c)
onclick
d)
functionName()
42.
Which 1 of the following symbols is used for JavaScript comments?
a)
\\
b)
^
c)
?
d)
//
43.
What is CSS used for?
a)
styling web pages
b)
formatting script correctly
c)
client side scripting
d)
server side scripting
44.
How do we generate a random number?
a)
Math.random()
b)
random.number()
c)
number.random()
d)
Random.math()
45.

Which of the following platform(s) can be used to run Javascript Code

a)

Google Chrome

b)

Firefox

c)

Microsoft Edge

d)

Safari

46.
How do I change the size of an image?
a)
width / height
b)
scale
c)
size
d)
shrink
47.

You can change an image's size using Javascript?

a)

True

b)

False

48.

1.Which of the following is the correct tag to create a text box?

a)

<input> text </input>

b)

<text>

c)

<input = “text”>

d)

<input type = “text”>

49.

Which of the following is the correct way to add an attribute?

a)

<src>

b)

classes:ids

c)

id="title"

d)

<id>

50.

What symbol should you use to target an id in css?

a)

.

b)

+

c)

id

d)

#

51.

What symbol should you use to target a class name in css?

a)

#

b)

()

c)

.

d)

class

52.

TRUE OR FALSE: HTML is used to style web pages.

a)

True

b)

False

53.

TRUE OR FALSE: CSS is used to style web pages

a)

True

b)

False

54.

How do you change the font color with CSS?

a)

font-color: green;

b)

color: green;

c)

change-font-color: green;

d)

fontcolor=green;

55.
A properly coded HTML tag will always be found between which two symbols?
a)
( )
b)
{ }
c)
[ ]
d)
< >
56.

CSS stands for

a)

Code Style Sheet

b)

Coding Style Sheet

c)

Cascading Sheet Style

d)

Cascading Style Sheet