wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

html css and javascript

Total questions: 50

Worksheet time: 26mins

Name
Class
Date
1.
HTML attributes always appear where?
a)
In the opening tag
b)
In the closing tag
c)
Between the tags
d)
After the closing tag
2.
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
3.
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
4.
Which is the correct HTML element for inserting a line break?
a)
<b>
b)
<lb>
c)
<br>
d)
<break>
5.
Web Standards are decided on by who?
a)
Microsoft
b)
Apple
c)
W3C
d)
Google
6.
Which character is used to indicate an end tag?
a)
*
b)
<
c)
/
d)
^
7.
You should save HTML files with which file extension?
a)
.htm
b)
.index
c)
.webpage
d)
.html
8.

Which tag indicates the presence of javascript

a)

<css>

b)

<script type="text/javascript">

c)

<?php>

d)

<style>

9.

javascript can be written within

a)

<head> tag only

b)

<body> tag only

c)

it can be written within both <head> and <body> tag

d)

none of the above

10.

When the javascript code is written inside html it will be saved as

a)

.html

b)

.css

c)

.js

d)

none of the above

11.

in javascript what command is equivalent to print statement of c program

a)

alert

b)

write

c)

print

d)

echo

12.

<html>

<head>

<script>

function add(){

var a=10;

var b=20;

document.write("sum is "+c);

</script></head>

<body>

<button onclick="add()">add 2 numbers</button>

</body>

</html>

a)

30

b)

40

c)

error

d)

none of the above

13.

WHAT IS THE OUTPUT

<html>

<head>

<script>

function add(){

document.getElementById("one").innerhtml="AFTER CHANGE";

</script></head>

<body>

<p id="one">BEFORE CHANGE</p>

<button onclick="add()">change</button>

</body>

</html>

a)

PARAGRAPH CONTENT CHANGED TO AFTER CHANGE

b)

PARAGRAPH CONTENT REMAINS SAME

c)

ERROR

d)

ONLY BUTTON WILL APPEAR

14.

Javascript is

a)

client side scripting language

b)

server side scripting language

c)

both client and server side scripting language

d)

none of the above

15.

Which of the following is correct

a)

document.getElementByID(" ")

b)

document.getElementByName(" ")

c)

document.getElementByClass(" ")

d)

all of the above

16.

Which are the main features of XML?

a)

Text data description

b)

Human- and computer-friendly format

c)

Handles data in a tree structure having one-and only one-root element

d)

All mentioned above

17.

Is this a 'well formed' XML document?

< ?xml version="1.0"? >

< note >

< to age="29" >John< /to >

< from >Smiley< / from >

< / note >

a)

True

b)

False

18.

To use the external DTD we have the syntax

a)

<?xml version=”A.0” standalone=”no”?>

<! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>

b)

<?xml version=”A.0” standalone=”yes”?>

<! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>

c)

<?xml version=”A.0” standalone=”no”?>

<! DOCTYPE DOCUMENT “order.dtd”?>

d)

<?xml version=”A.0” standalone=”yes”?>

<! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>

19.

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

20.

<script type="text/javascript">

x=4+"4";

document.write(x);

</script>

Output------?

a)

44

b)

8

c)

4

d)

Error output

21.

Which one is the correct order of phases in JSP life cycle?

a)

Initialization, Cleanup, Compilation, Execution

b)

Initialization, Compilation, Cleanup, Execution

c)

Compilation, Initialization, Execution, Cleanup

d)

Cleanup, Compilation, Initialization, Execution

22.

Which of the following action variable is used to include a file in JSP?

a)

jsp:setProperty

b)

jsp:getProperty

c)

jsp:include

d)

jsp:plugin

23.

“out” is implicit object of which class?

a)

javax.servlet.jsp.PrintWriter

b)

javax.servlet.jsp.SessionWriter

c)

javax.servlet.jsp.SessionPrinter

d)

javax.servlet.jsp.JspWriter

24.

In JSP Action tags which tags are used for bean development?

a)

jsp:useBean

b)

jsp:setPoperty

c)

jsp:getProperty

d)

All mentioned above

25.

Which technology do we mix our business logic with the presentation logic?

a)

Servlet

b)

JSP

c)

Both A & B

d)

None of the above

26.

In JSP page directive which attribute defines the MIME(Multipurpose Internet Mail Extension) type of the HTTP response?

a)

import

b)

contentType

c)

extends

d)

info

27.

Which syntax is used to comment in JSP?

a)

<!-- Comment -->

b)

<@-- Comment -->

c)

<%-- Comment -->

d)

<&-- Comment -->

28.

Which implicit object of JSP is equivalent to this variable of Java programming language?

a)

page

b)

pageContext

c)

config

d)

application

29.

Choose the correct syntax of include directive?

a)

<%@ include page="file.jsp" %>

b)

<% include file="file.jsp" %>

c)

<%@ include file="file.jsp" %>

d)

<%! include page="file.jsp" %>

30.

Which method is called only once in Servlet life cycle ?

a)

service()

b)

initialize()

c)

init()

d)

all of the above

31.

Which method defined in the HttpServletRequest returns the object of RequestDispatcher ?

a)

getRequestDispatcher()

b)

getDispatcher()

c)

getRequest()

d)

requestDispatcher()

32.

If the client has disabled cookie in the browser, which session management mechanism could the web container employ ?

a)

Session Management using Cookies

b)

Session Management using URL rewriting

c)

Either Cookies or URL rewriting

d)

Cookies and URL rewriting must be used together

33.

Cookies are stored on _______ side.

a)

Client

b)

Server

c)

database

d)

none

34.

Which method is used to delete a session?

a)

invalidateSession()

b)

invalidate()

c)

deleteSession()

d)

delete()

35.

Which method is used access the cookies that are added to response object?

a)

getCookies()

b)

getNewCookies();

c)

cookies();

d)

returnCookies();

36.
What does WYSIWYG stand for?
a)
when you sing is what you get
b)
why your sight is wearing your glasses
c)
what you sign is where you go
d)
what you see is what you get
37.
Short for Asynchronous JavaScript and XML. With this web apps can send and receive data in the background without disrupting the display and behavior of the page.
a)
AJAX
b)
JSON
c)
HTML
d)
Drupal
e)
Library
38.
Domain Name System. See the entry "Name Server" on this point.
a)
DNS
b)
AJAX
c)
HubL
d)
JavaScript
e)
Custom Module
39.
is a part of CSS code that defines which HTML element the CSS styling effects. For example if element “p” (say, a specific paragraph) is a selector, then
a)
Selector
b)
Value
c)
Apache
d)
Domain/subdomain
e)
Angular
40.
Secure Sockets Layer is a security technology for establishing an encrypted link between a web server and a browser. This is absolutely necessary when dealing with monetary transactions.
a)
SSL
b)
Web Host / Web Server
c)
CDN
d)
Media Query
e)
jQuery
41.
Which of the following formatting tags are HTML and DO NOT need to be inside of the <script> </script> tags?
a)
<div>
b)
<h1>
c)
<h3>
d)
all
42.

Inside which HTML element do we put the JavaScript?

a)

<js>

b)

<script>

c)

<scripting>

d)

<javascript>

43.

Which of the following is the correct Javascript format for a comment?

a)

// "the text"

b)

/"the text"/

c)

*/"the text"/*

d)

\\"the text

44.

Which message will the user see? / Quel message l'utilisateur verra-t-il?

a)

"Hello user"

b)

No message

c)

"Goodbye user"

d)

"message + user"

45.

How can a developer show a pop-up message to the user?

a)

alert

b)

prompt

c)

console.log

d)

<p> tag

46.

What is the correct syntax for referring to an external JavaScript script?

a)

<script src="myscript.js"></script>

b)

<script href="myscript.js"></script>

c)

<js href="myscript.js"></js>

d)

<js src="myscript.js"></js>

47.

What attribute/value do we use to make a button execute JavaScript when clicked?

a)

onclick="doSomething;"

b)

on-click="doSomething;"

c)

onclick="doSomething();"

d)

onclick=doSomething();

48.

Which option is true about session scope?

a)

Objects are accessible only from the page in which they are created

b)

Objects are accessible only from the pages which are in same session

c)

Objects are accessible only from the pages which are processing the same request

d)

Objects are accessible only from the pages which reside in same application

49.

Which one of the following is correct for directive in JSP?

a)

<%@directive%>

b)

<%!directive%>

c)

<%directive%>

d)

<%=directive%>

50.

How many jsp implicit objects are there and these objects are created by the web container that are available to all the jsp pages?

a)

8

b)

9

c)

10

d)

7