wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

HTML CSS JS Teacher Assessment

Total questions: 40

Worksheet time: 21mins

Name
Class
Date
1.

URL for link is specified using ___ attribute.

a)

src

b)

href

c)

link

d)

rel

2.

For defining internal links in a page we use -

a)

class

b)

target

c)

src

d)

id

3.

What is the correct syntax for writing ‘doctype’ in HTML5?

a)

<!DOCTYPE HTML>

b)

<!doctype html>

c)

<!DOCTYPE html>

d)

All of the above

4.

To start a list at the count of 3, use -

a)

<ol begin="3">

b)

<ol start="3">

c)

<ol num = "3">

d)

<ol list="3">

5.

Which of the following is used to open documents in a new window?

a)

<a target="_self">Link</a>

b)

<a target="_top">Link</a>

c)

<a target="_parent">Link</a>

d)

<a target="_blank">Link</a>

6.

Which of the following will show an image located in folder named ‘image’, which is in the parent folder of the current page?

a)

<img src="pic.img">

b)

<img src="../pic.img">

c)

<img src="../image/pic.img">

d)

<img src="image/pic.img">

7.

The element <DIV> has which of the following property?

a)

provides some properties to some elements inside it

b)

define content to be block-level

c)

define content to be inline

d)

none of the above

8.

How will the elements in the given code be shown:


<img src=”img.jpg” width=”100” />

<a href=””>This is image</>

a)

The link will be displayed above the image.

b)

The link will be displayed next to the image.

c)

The link will be displayed below the image.

d)

The link will be displayed before the image.

9.

Increasing the cell padding means -

a)

increase the softness of your site

b)

increase the space between cells

c)

increase the distance between cell and content

d)

all of the above

10.

How will the code above look like in the browser?

a)
b)
c)
d)
11.

Which attribute is used to provide an advisory text about an element or its contents?

a)

tooltip

b)

value

c)

title

d)

none of the above

12.

Which element is used to take input from the user that can be sent to the server?

a)

<form>

b)

<label>

c)

<input>

d)

<select>

13.

Adding which of the following to the input box makes it compulsory to be filled out when submitting the form?

a)

type="required"

b)

important

c)

compulsory

d)

required

14.

To create a drop-down which tag will you use?

a)

<select>

b)

<list>

c)

<input type="dropdown">

d)

Any of the above

15.

What does the action attribute define?

a)

Specify the action to be performed on the form content.

b)

Specify the address on the server to send the form content to.

c)

Specify the method to call when the form is submitted.

d)

None of the above.

16.

Which of the following is not the keyword of form method attribute?

a)

GET

b)

POST

c)

PUT

d)

OUT

17.

Which of the following attributes adds audio controls, like play, pause, and volume?

a)

audio

b)

source

c)

src

d)

controls

18.

Which attribute gives the value associated with the http-equiv or name attribute?

a)

content

b)

name

c)

charset

d)

http-equiv

19.

In which of the following ways can a submit button be created?

a)

<input type=”submit” value=”Submit” />

b)

<button>Submit</button>

c)

<button type=”submit”>Submit</button>

d)

<button submit>Submit</>

20.

How to apply styles to para’s having class ‘style’? (There are other elements with the same class name)

a)

p

b)

p.style

c)

p-style

d)

.style

21.

An HTML code is written as the following, how would this look in the browser?

a)
b)
c)
d)

None of the above.

22.

Which of the following is not used with the text-decoration property?

a)

overline

b)

underline

c)

line-through

d)

inline

23.

For the code:

<div>This is div.</div>

<span>This is span.</span>

<p>This is para.</p>


The page is as shown in figure above, How will the page look like, when the <span> and <p> elements are moved inside the <div> element and ‘display:inline;’ style is added to the <div> element?

a)
b)
c)
d)

None of the above.

24.

The 3 boxes with the position value set are shown on the web page as in the image above, if the property “top: 0;” is added to the element with a blue border, then how will it be shown on the web page?

a)
b)
c)
d)
25.

Which property is used to align flex lines?

a)

align-items

b)

justify-content

c)

flex-align

d)

align-content

26.

In the shortened property flex: 1 0 auto; which property refers to the 2nd value (here 0)?

a)

flex-grow

b)

flex-basis

c)

flex-shrink

d)

flex-grow

27.

A small necessary code is provided for the given flex container as shown in the image above -


.flex-container {

display: flex;

justify-content: space-between;

width: 300px;

flex-wrap: nowrap;

}

.flex-container > div {

background-color: #f1f1f1;

width: 50px;

margin: 10px;

}


What is the space between any of the 2 divs?

a)

20px

b)

30px

c)

10px

d)

15px

28.

Which of the following media features can be used in defining a media query?

a)

min-width

b)

orientation

c)

frame

d)

max-height

29.

The CSS for a web page is provided above. Now, what will be the background color of the page, when the width of the device is 600px?

a)

lightgrey

b)

lightblue

c)

lightgreen

d)

white

30.

What can we achieve using Javascript?

a)

Add visual graphics to the web page.

b)

Add interaction on a web page.

c)

Change HTML content on certain event conditions.

d)

Handle events on buttons and inputs.

31.

Which of the following are basic data types in Javascript?

a)

integer

b)

null

c)

character

d)

object

32.

What will be printed on the console from the following code,


var a;

console.log(a);

a)

0

b)

undefined

c)

null

d)

Show error- "a is not defined"

33.

What will the below line print on the console?


console.log(1 + '1')

a)

98

b)

11

c)

2

d)

Show error- "TypeMismatch"

34.

Which of the following statements will print 'hii' at least once?

a)

A

b)

B

c)

C

d)

D

35.

Which of the following will display an alert box on the web page?

a)

window.alert();

b)

alert();

c)

Both of the above

d)

None of the above

36.

What will the below statement print on the console?


typeof( typeof( typeof( 100 ) ) )

a)

"number"

b)

"integer"

c)

"string"

d)

None of the above

37.

Consider the code given below -


var arr = [ 1, , 3, 4 ];


What is the observation made?

a)

The omitted values take "undefined".

b)

This results in an error.

c)

This results in an exception.

d)

The omitted value takes an integer value 0.

38.

What will be the output of the following code snippet?


var a = 1;


function b() {

a = 10;

return;

function a() { }

}


b();

console.log(a);

a)

10

b)

1

c)

f b() { a=10; return; function a() {} }

d)

a

39.

What is the output of the following code?


var words = ['one', 'two', 'three', 'four'];


words.forEach(function(word) {

console.log(word);

if (word === 'two') {

words.shift();

}

});

a)

two three four

b)

one three four

c)

one two four

d)

one two three four

40.

Which of the method will run a function 'abc' after 5 seconds?

a)

setTimeOut(abc, 5000);

b)

window.setTimeOut(abc, 5000);

c)

Function.setTimeOut(abc, 5000);

d)

None of the above