wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SP- Level 2

Total questions: 50

Worksheet time: 25mins

Name
Class
Date
1.

How is document type initialized in HTML5.?

a)

</DOCTYPE HTML>

b)

</DOCTYPE>

c)

</DOCTYPE html>

d)

<!DOCTYPE HTML>

2.

Which of the following is the correct syntax for referring the external style sheet?

a)

<style src = example.css>

b)

<style src = "example.css" >

c)

<stylesheet> example.css </stylesheet>

d)

<link rel="stylesheet" type="text/css" href="example.css">

3.

Inside which HTML element do we put the JavaScript?

a)

<script>

b)

<javascript>

c)

<js>

d)

<scripting>

4.

What is the correct JavaScript syntax to change the content of the HTML element below?<p id="demo">This is a demonstration.</p>

a)

document.getelemnt.id(demo).innerHTML='hello'

b)

document.getElemntById('demo').innerHTML='hello'

c)

document.getElemntById('#p').innerHTML='hello'

d)

document.getElemntById('demo').innerhtml='hello'

5.

Where is the correct place to insert a JavaScript?

a)

Head

b)

body

c)

both

6.

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

a)

<link rel='javascript' href='xxx.js'>

b)

<script src='xxx.js'></script>

c)

<script href='xxx.js'></script>

7.

Which of these elements are all <table> elements?

a)

<table><tr><td>

b)

<table><td><tr>

c)

<table><tr></tr><td>

d)

<table></table>

8.

Which of the following is a font property?

a)

Color

b)

size

c)

family

d)

all the above

9.

Multimedia can be embedded in an HTML document.

a)

True

b)

False

c)

Maybe

10.

Change the border size of the body or image

a)

border-style

b)

border-color

c)

border-width

d)

width

11.

What does a class do?

a)

adds color to words

b)

adds style to specific elements

c)

adds a lot more work

d)

adds style to a whole page

12.

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

a)

p {

color: blue;

}

b)

body {

text-position: left;

color: blue;

}

c)

p {

text-align: center,

color: blue;

}

d)

body {

text-align: center;

color: blue;

}

13.

What will this rule set create?

h1 {

text-decoration: underline overline dotted red;

}

a)

red waves under the heading

b)

red dots over and under the heading

c)

red waves over and under the heading

d)

red dots over the heading

14.

What will this rule set create?

<script>

functionname loop()

{

for(I=0;i<=3;i++)

print('SP Competition

}

<button onclick='loop()'>loop</button>

a)

wrong syntax

b)

SP competition

SP competition

SP competition

SP competition

c)

print('sp competition')

d)

SP competition

SP competition

SP competition

15.

Which of the following is true about variable naming conventions in JavaScript?

a)

JavaScript variable names must begin with a letter or the underscore character.

b)

JavaScript variable names are case sensitive.

c)

Both of the above.

d)

None of the above.

16.

Which of the following is the correct syntax to alert a page using JavaScript?

a)

window.alert();

b)

browser.alert();

c)

navigator.alert();

d)

document.alert();

17.

JavaScript is a ___ -side programming language.

a)

Client

b)

Server

c)

both

d)

none of them

18.

Which of the following statements will throw an error?Please select 2 correct answers

a)

var fun = 'hello'

b)

var fun = function bar{ }

c)

function fun( ){ }

d)

Function fun( ){ }

19.

Which are the correct “if” statements to execute certain code if “x” is equal to 2?

a)

if(x 2)

b)

if(x = 2)

c)

if(x == 2)

d)

if(x != 2 )

20.

Which of the following print a content on the browser window?

a)

document.write(“print content”);

b)

response.write(“print content”);

c)

document.write(print content);

d)

write(“print content”);

21.

Which of the following statements will show a message as well as ask for user input in a popup?

a)

alert()

b)

prompt()

c)

confirm()

d)

message()

22.

Opening Tag of HTML Tag is called as ________.

a)

Closed Tag

b)

Forward Tag

c)

Starting Tag

d)

Enging Tag

23.

HTML Code written in MAC can be browsed in a PC with Window 7 installed , User will be able to see same design that was designed on the MAC Pc.

a)

True

b)

False

c)

May be

24.

Which of the following attributes comes in handy when borders have to be put between groups of columns instead of every column?

a)

rowspan

b)

colspan

c)

border-collapse

d)

Row

25.

Which of the following is valid colour code ?

a)

#000000;

b)

#0000000;

c)

#00000000;

d)

#000000000;

26.

The href attribute in the link tag specifies the:

a)

Destination of a link.

b)

Link

c)

Hypertext

d)

None of the above

27.

What are <div> tags used for?

a)

To replace paragraphs. i.e. p tags

b)

To logically divide the paragraphs

c)

To logically divide the document

d)

To provide space between tables

28.

How can we resize the image?

a)

Using resize attribute

b)

Using height and width

c)

Using size attribute

d)

Using rs attribute

29.

When creating a Web document, what format is used to express an image's height and width?

a)

Pixels

b)

Centimeters

c)

Dots per inch

d)

Inches

30.

What does an HTML tag do?

a)

It determines the organizational structure of your Web site.

b)

It connects your web site to an operating environment.

c)

it hides programming instructions from view.

d)

it specifies formatting and layout instructions for your web page.

31.

If background image is smaller than the screen, what will happen?

a)

it'll be stretched

b)

it'll be repeated

c)

it'll leave blank space at the

d)

None of these

32.

select the correct element for defining a navigation menu for your site.

a)

a

b)

h

c)

div

d)

ul

33.

How can you created rounded corners using CSS3?

a)

border[round]: 30px;

b)

corner-effect: round;

c)

border-radius: 30px;

d)

alpha-effect: round-corner;

34.

How to resize a background image using CSS3?

a)

background-size: 80px 60px

b)

bg-dimensions: 80px 60px;

c)

background-proportion: 80px 60px;

d)

alpha-effect: bg-resize 80px 60px;

35.

Has CSS3 been fully supported by all browsers?

a)

Yes

b)

No

36.

How do four values work on border-radius

a)

top, bottom, left, right

b)

up, down, front, behind

c)

top-left, top-right, bottom-right, bottom-left

d)

bottom-left, bottom-right, top-right, top-left

37.

What is css Float?

a)

allows other elements to wrap around an element

b)

element can be pushed to the left or right

c)

both a and b above

d)

element can be pushed to any direction

38.

In CSS, it is not possible to specify different padding for different sides

a)

True

b)

False

c)

Maybe

39.

____________ property specifies an image to use as the background of an element

a)

backg-img

b)

backg-image

c)

background-img

d)

background-image

40.

The _____________ selector is used to specify a style for a single, unique element

a)

id

b)

class

c)

tag name

d)

selector

41.

Which of the below is the correct way to set a font size?

a)

h2 {font-size:200%;}

b)

h2 {font-size:200px;}

c)

both a and b above

d)

h2 {font-size:200;}

42.

If you put a value of 0 for a Border-Radius what will happen?

a)

The Corner will curve horizontal.

b)

The Corner will be square

c)

The Corner will curve vertical.

d)

The world will end.

43.

JavaScript ignores extra spaces

a)

true

b)

false

c)

raise error

44.

html ignores extra spaces

a)

true

b)

false

c)

raise error

45.

css ignores extra spaces

a)

true

b)

false

c)

raise error

46.

Which of the following is correct to write “Hello World” on the web page?

a)

System.out.println('Hello World')

b)

print('Hello World')

c)

document.write('Hello World')

d)

response.write('Hello World')

47.

changing background color using javascript for whole the page

a)

document.getElementById('bd').style.backgroundcolor='deepskyblue';

b)

document.getElementById('bd').style.backgroundColor='deepskyblue';

c)

document.getElementById(body).style.backgroundcolor='deepskyblue';

d)

document.getElementById('bd').style.backgroundcolor('deepskyblue')

48.

which loop will run at least one time even if the condition will not recognized

a)

while loop

b)

do while loop

c)

for loop

d)

none of them

49.

the correct syntax for the do while loop

a)

do()

{

loop body

}

while(condition)

b)

do

{

loop body

}

while(condition)

c)

do

{

loop body;

I++;

}

while(condition)

d)

Do

{

loop body

}

while(condition)

50.

Which of these expressions is NOT a valid way to add 1 to a variable in JavaScript?

a)

x++

b)

x += 1

c)

x = x + 1

d)

x+