Professional Documents
Culture Documents
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
PART A (2 Marks)
(Minimum of 20 Questions in each Unit of type MCQ, True or False or open question type, no
maximum limit)
Unit I
1) What is the correct HTML tag for inserting a line break?
a. <br>
b. <lb>
c. <break>
d. <newline>
Ans : a
2) What is the correct HTML for adding a background color?
a. <body color=yellow>
b. <body bgcolor=yellow>
c. <background>yellow</background>
d. <body background=yellow>
Ans:b
3) Choose the correct HTML tag to make a text italic
a. <ii>
b. <italics>
c. <italic>
d. <i>
Ans : d
4) Choose the correct HTML tag to make a text bold?
a. <b>
b. <bold>
c. <bb>
d. <bld>
Ans: a
5) What should be the first tag in any HTML document?
a. <head>
b. <title>
c. <html>
d. <document>
Ans : c
6) Which tag allows you to add a row in a table?
a. <td> and </td>
b. <cr> and </cr>
c. <th> and </th>
d. <tr> and </tr>
Ans : d
7) How can you make a bulleted list?
a. <list>
b. <nl>
c. <ul>
d. <ol>
Ans : c
8) Which tag inserts a line horizontally on your web page?
a. <hr>
b. <line>
c. <line direction=horizontal>
Page 1 of 44
Question Bank
Class :
III BCOM (CA) A&B
Subject :
Technology
Sem :
VI
d. <tr>
Ans : a
9) <b> tag makes the enclosed text bold. What is other tag to make text bold?
a. <strong>
b. <dar>
c. <black>
d. <emp>
Ans : a
10) A webpage displays a picture. What tag was used to display that picture?
a. picture
b. mage
c. img
d. src
Ans: C
Web Design
Question Bank
Class :
III BCOM (CA) A&B
Technology
Sem :
c. transport control protocol / internet protocol
d. none of the above
Ans : a
18)What is the full form of HTML?
a. Hyper textmarkup language
b. Hyphenation text markup language
c. Hyphenation test marking language
d. Hyper text marking language
Ans : a
19) What is the full form of HTTP?
a. Hyper text transfer protocol
b. Hyper text transfer package
c. Hyphenation text test program
d. none of the above
Ans : a
20)Which tag creates a check box for a form in HTML?
a. <checkbox>
b. <input type=checkbox>
c. <input=checkbox>
d. <input checkbox>
Ans : b
Subject :
Web Design
VI
Unit II
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
C) i-True, ii-True
D) i-False, ii-False
Answer: C) i-True, ii-True
23. The CSS links properties are
A) :link, :visited, :hover, :active
B) :link, :visit, :hover, :active
C) :link, :visited, :over, :active
D) :link, :visited, :hover, :active, :inactive
Answer: . A) :link, :visited, :hover, :active
24. Internet Exploreruses .......................property to create transparent images.
A) -moz-opacity:x
B) filter: alpha(opacity=x)
C) Both of the above
D) None of the above
Answer: B) filter: alpha(opacity=x)
25. The different ways to associate styles with a HTML document is/are
A) Embedded CSS with <style> element
B) Inline CSS with style attribute.
C) External CSS with <link> element.
D) All of the above
Answer: D) All of the above
26. Which of the following is correct CSS syntex for using font property?
A) <p style="font: italic, bold, 15px;"> ................ </p>
Page 4 of 44
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
30. The ..................... specifies whether a border should be solid, dashed line, doted line,
double line, groove etc.
A) border-layout
B) border-decoration
C) border-style
D) border-weight
Answer: C) border-style
31. Which of the following are the advantages of CSS?
i) CSS saves time ii) Page load faster
iii) Easy maintenance iv) Multiple compatibility
A) i, ii and iii only
B) ii, iii and iv only
C) i, ii and iv only
D) All i, ii, iii and iv
Answer : D) All i, ii, iii and iv
32. A CSS style rule is made up of three parts which are ..
i) Selector ii) Property
iii) Value iv) Attribute
A) i, ii and iii only
B) ii, iii and iv only
C) i, ii and iv only
D) All i, ii, iii and iv
Answer : A) i, ii and iii only
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
B) Universal selector
C) Local selector
D) Descendant selector
Answer : C) Local selector
34. The correct example of class selector is .
A) h2.type1 {color: #000000;}
B) h2 type1 {color: #000000;}
C) h2 #type1 {color: #000000;}
D) #h2 type1 {color: #000000;}
Answer : A) h2.type1 {color: #000000;}
35. CSS comments are inserted inside .
A) //...................//
B) <!..................>
C) /*..................*/
D) All of the above
Answer : C) /*..................*/
36. We can handle old browsers by placing CSS codes inside.
A) //...................//
B) <!..................>
C) /*..................*/
D) None of the above
Answer : B) <!..................>
37. State whether True or False.
i) Any inline style sheet takes highest priority.
ii) Any rule defined in <style> ...........................</style> tag will override rules defined in any
external style sheet file.
Page 7 of 44
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
A) i-True, ii-False
B) i-False, ii-True
C) i-True, ii-True
D) i-False, ii-False
Answer : C) i-True, ii-True
38. ...................... is used to import an external style sheet in a manner similar to the <link>
element.
A) @insert
B) @import
C) #import
D) #insert
Answer : B) @import
39. Which of the following is / are the measurement units in CSS?
i) % ii) cm iii) em iv) pc v) px
A) i, ii, iii and iv only
B) i, ii, iii and v only
C) i, ii, iv and v only
D) All i, ii, iii, iv and v
Answer : D) All i, ii, iii, iv and v
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
Unit III
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
46. _____ JavaScript statements embedded in an HTML page can respond to user events
such as mouse-clicks, form input, and page navigation.
A. Client-side
B. Server-side
C. Local
D. Native
Ans: A
47. What should appear at the very end of your JavaScript?
The <script LANGUAGE="JavaScript">tag
A. The </script>
B. The <script>
C. The END statement
D. None of the above
Ans: A
48. Which of the following can't be done with client-side JavaScript?
A. Validating a form
B. Sending a form's contents by email
C. Storing the form's contents to a database file on the server
D. None of the above
Ans: C
49. Which of the following are capabilities of functions in JavaScript?
A. Return a value
B. Accept parameters and Return a value
C. Accept parameters
D. None of the above
Ans: C
50. Which of the following is not a valid JavaScript variable name?
A. 2names
B. _first_and_last_names
C. FirstAndLast
D. None of the above
Ans: A
51. ______ tag is an extension to HTML that can enclose any number of JavaScript
statements.
A. <SCRIPT>
B. <BODY>
C. <HEAD>
D. <TITLE>
Ans: A
52. How does JavaScript store dates in a date object?
A. The number of milliseconds since January 1st, 1970
B. The number of days since January 1st, 1900
C. The number of seconds since Netscape's public stock offering.
D. None of the above
Page 10 of 44
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
Ans: A
53. Which of the following attribute can hold the JavaScript version?
A. LANGUAGE
B. SCRIPT
C. VERSION
D. None of the above
Ans: A
54. What is the correct JavaScript syntax to write "Hello World"?
A. System.out.println("Hello World")
B. println ("Hello World")
C. document.write("Hello World")
D. response.write("Hello World")
Ans: C
55. Which of the following way can be used to indicate the LANGUAGE attribute?
A. <LANGUAGE="JavaScriptVersion">
B. <SCRIPT LANGUAGE="JavaScriptVersion">
C. <SCRIPT LANGUAGE="JavaScriptVersion"> JavaScript statements</SCRIPT>
D. <SCRIPT LANGUAGE="JavaScriptVersion"!> JavaScript statements</SCRIPT>
Ans: C
56. Inside which HTML element do we put the JavaScript?
A. <js>
B. <scripting>
C. <script>
D. <javascript>
Ans: C
57. 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
Ans: C
58. Which types of image maps can be used with JavaScript?
A. Server-side image maps
B. Client-side image maps
C. Server-side image maps and Client-side image maps
D. None of the above
Ans: B
59. Which of the following navigator object properties is the same in both Netscape and IE?
A. navigator.appCodeName
B. navigator.appName
C. navigator.appVersion
D. None of the above
Ans: A
Page 11 of 44
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
A. Database
B. Cursor
C. Client
D. FileUpLoad
Ans: D
67. Which of the following is not considered a JavaScript operator?
A. new
B. this
C. delete
D. typeof
Ans: B
68. ______method evaluates a string of JavaScript code in the context of the specified
object.
A. Eval
B. ParseInt
C. ParseFloat
D. Efloat
Ans: A
69. Which of the following event fires when the form element loses the focus: <button>,
<input>, <label>, <select>, <textarea>?
A. onfocus
B. onblur
C. onclick
D. ondblclick
Ans: B
70. The syntax of Eval is ________________
A. [objectName.]eval(numeriC.
B. [objectName.]eval(string)
C. [EvalName.]eval(string)
D. [EvalName.]eval(numeriC.
Ans: B
71. JavaScript is interpreted by _________
A. Client
B. Server
C. Object
D. None of the above
Ans: A
72. Using _______ statement is how you test for a specific condition.
A. Select
B. If
C. Switch
D. For
Ans: B
Page 13 of 44
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
Page 14 of 44
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
79. In JavaScript, _________ is an object of the target language data type that encloses an
object of the source language.
A. a wrapper
B. a link
C. a cursor
D. a form
Ans: A
80. When a JavaScript object is sent to Java, the runtime engine creates a Java wrapper of
type ___________
A. ScriptObject
B. JSObject
C. JavaObject
D. Jobject
Ans: B
.
Unit V
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
A. IE C.0
B. IE B.0
C. IE 6.0
D. IE X.0
Ans: C
98. There is a way of describing XML data, how?
A. XML uses a DTD to describe the data
B. XML uses XSL to describe data
C. XML uses a description node to describe data
D. Both A and C
Ans: D
99. What does DTD stand for?
A. Direct Type Definition
B. Document Type Definition
C. Do The Dance
D. Dynamic Type Definition
Ans: B
100. DTD includes the specifications about the markup that can be used within the document,
the specifications consists of all EXCEPT
A. the browser name
B. the size of element name
C. entity declarations
D. element declarations
Ans: A
PART B (5 Marks)
(Minimum 10 Question from Each unit, no maximum limit)
Unit I
1.Write a Basic Program in HTML
Answer
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
Page 18 of 44
Question Bank
Class :
III BCOM (CA) A&B
Technology
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
Subject :
Sem :
Web Design
VI
</body>
</html>
2.Write a program using HTML Attributes
Answer
<!DOCTYPE html>
<html>
<body>
<h1>About W3Schools</h1>
<p title="About W3Schools">
W3Schools is a web developer's site.
It provides tutorials and references covering
many aspects of web programming,
including HTML, CSS, JavaScript, XML, SQL, PHP, ASP, etc.
</p>
<p><b>
If you move the mouse over the paragraph above,
the title will display as a tooltip.
</b></p>
</body>
</html>
the<p> element has a title attribute. The value of the attribute is "About
W3Schools":
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
</body>
</html>
5.Write a program using HTML-TextAlign attribute
Answer
<!DOCTYPE html>
<html>
<body>
<h1 style="text-align:center">Centered heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
6.Write a program using HTML-Font attribute
<!DOCTYPE html>
<html>
<body>
<h1 style="font-family:verdana">This is a heading</h1>
<p style="font-family:courier">This is a paragraph.</p>
</body>
</html>
Question Bank
Class :
III BCOM (CA) A&B
Subject :
Technology
Sem :
VI
<p><b>This text is bold.</b></p>
<p><strong>This text is strong.</strong></p>
<p><i>This text is italic.</i></p>
<p><em>This text is emphasized.</em></p>
<h2>HTML <small>Small</small> Formatting</h2>
Web Design
</body>
</html>
9.Write a program using HTML-Links attribute
Answer
<!DOCTYPE html>
<html>
<body>
<p><a href="http://www.w3schools.com/html/">Visit our HTML
tutorial</a></p>
</body>
</html>
10.Write a program using HTML-Un-Ordered List attribute
Answer
<!DOCTYPE html>
<html>
<body>
<h2>Unordered List with Circle Bullets</h2>
<ul style="list-style-type:circle">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
</body>
</html>
.
Unit II
11.Write a CSS program id selector
Answer:
<!DOCTYPE html>
<html>
<head>
<style>
Page 21 of 44
Question Bank
Class :
III BCOM (CA) A&B
Technology
#para1 {
text-align: center;
color: red;
}
</style>
</head>
<body>
Subject :
Sem :
Web Design
VI
Hello World!
This paragraph is not affected by the style.
12.Write a program for The class selector (for only <p> elements)
Answer:
<!DOCTYPE html>
<html>
<head>
<style>
text-align: center;
p.center {
color: red;
}
</style>
</head>
<body>
<h1 class="center">This heading will not be affected</h1>
<p class="center">This paragraph will be red and center-aligned.</p>
</body>
</html>
Output
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
Question Bank
Class :
III BCOM (CA) A&B
Technology
img.top {
vertical-align: text-top;
}
Subject :
Sem :
Web Design
VI
img.bottom {
vertical-align: text-bottom;
}
</style>
</head>
<body>
<p>An <imgsrc="w3schools_logo.gif" alt="W3Schools" width="270" height="50"> image with a
default alignment.</p><br>
<p>An <img class="top" src="w3schools_logo.gif" alt="W3Schools" width="270" height="50">
image with a text-top alignment.</p><br>
<p>An <img class="bottom" src="w3schools_logo.gif" alt="W3Schools" width="270" height="50">
image with a text-bottom alignment.</p>
</body>
</html>
15. list the css background properties
Answer:
List the type and descriptions(tables).
16. Explain the concepts of CSS border properties
Answer:
List the type and descriptions(tables).
17. Explain the concepts of CSS padding properties
Answer:
List the type and descriptions(tables).
18. Explain the concept of CSS Text Alignment.
Answer:
Definition and example program.
19. write a program to Set the text color in CSS.
Answer:
<!DOCTYPE html>
<html>
<head>
<style>
body {
Page 24 of 44
Question Bank
Class :
III BCOM (CA) A&B
Technology
color: blue;
}
Subject :
Sem :
Web Design
VI
h1 {
color: green;
}
</style>
</head>
<body>
<h1>This is heading 1</h1>
<p>This is an ordinary paragraph. Notice that this text is blue. The default text color for a page is
defined in the body selector.</p>
</body>
</html>
20.Write a program to All the font properties in one declaration
Answer:
<!DOCTYPE html>
<html>
<head>
<style>
p.ex1 {
font: 15px arial, sans-serif;
}
p.ex2 {
font:italic bold 12px/30px Georgia, serif;
}
</style>
</head>
<body>
<p class="ex1">This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This
is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph.</p>
<p class="ex2">This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This
is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph.</p>
</body>
</html>
Unit III
21. write a basic program of Javascript
Answer:
Page 25 of 44
Question Bank
Class :
III BCOM (CA) A&B
Technology
<!DOCTYPE html>
<html>
<body>
Subject :
Sem :
Web Design
VI
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
.Unit IV
31. Write short note on Arrays
Answer:
Explanation with example programs
32. Write a short note on Associative Arrays
Answer:
Explanation with example programs
.
33. Write a short note Sorting an Array
Answer:
Explanation with example programs
34. Explain the Concept of Math Object
Answer
Explanation with syntax and its types
35. Explain the Concept of String Object
Answer
Explanation with syntax and its types and properties list
36. Explain the Concept of Date Object
Answer
Explanation with syntax and its types and properties list
.
37. Explain the Concept of Boolean Object
Answer
Explanation with syntax and its types and properties list
38. Explain the Concept of Number Object
Page 27 of 44
Question Bank
Class :
III BCOM (CA) A&B
Subject :
Technology
Sem :
VI
Answer
Explanation with syntax and its types and properties list
Web Design
Question Bank
Class :
III BCOM (CA) A&B
Technology
<style>
div {
width: 200px;
height: 100px;
border: 1px solid black;
}
</style>
</head>
<body>
Subject :
Sem :
Web Design
VI
Question Bank
Class :
III BCOM (CA) A&B
Technology
x.style.height = "64px";
x.style.width = "64px";
}
Subject :
Sem :
Web Design
VI
function normalImg(x) {
x.style.height = "32px";
x.style.width = "32px";
}
</script>
</body>
</html>
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
<p>When the input field gets focus, a function is triggered which changes the background-color.</p>
<script>
function myFunction(x) {
x.style.background = "yellow";
}
</script>
</body>
</html>
Question Bank
Class :
III BCOM (CA) A&B
Technology
alert("The form was submitted");
}
</script>
</body>
</html>
Subject :
Sem :
Web Design
VI
50. Write a program to Display the date and time the document was last modified.
Answer
<!DOCTYPE html>
<html>
<body>
<p>This document was last modified <span id="demo"></span>.</p>
<script>
document.getElementById("demo").innerHTML = document.lastModified;
</script>
</body>
</html>
Page 32 of 44
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
Unit II
6. Explain the concept of CSS borders briefly with example program
Answer:
border-color,border-style,Border Width,border-top-color
7. Explain the concepts of CSS text briefly with example programs
Answer:
Text colour , text alignment , text decoration,Text Transformation
8.
Question Bank
Class :
III BCOM (CA) A&B
Technology
Answer:
Explanations and programs.
Subject :
Sem :
Web Design
VI
Question Bank
Class :
III BCOM (CA) A&B
Technology
</body>
</html>
Subject :
Sem :
Web Design
VI
Unit- IV
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
MATH OBJECT
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Math.round()</h1>
<p>Math.round(x) returns the value of x rounded down to its nearest integer:</p>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = Math.round(4.4);
</script>
</body> </html>
DATE Object
The Date object is used to work with dates and times.
Date objects are created with new Date().
There are four ways of instantiating a date:
var d = new Date();
var d = new Date(milliseconds);
var d = new Date(dateString);
var d = new Date(year, month, day, hours, minutes, seconds, milliseconds);
<!DOCTYPE html>
Page 36 of 44
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
<html>
<body>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = Date();
</script>
</body>
</html>
3. Explain the concept of Boolean and Number object in detail
Answer
BOOLEAN
JavaScript booleans can have one of two values: true or false.
The Boolean() Function
You can use the Boolean() function to find out if an expression is true:
Example
Boolean(10 > 9)
Try it Yourself
Or even easier:
// returns true
Example
(10 > 9)
10 > 9
Program
<!DOCTYPE html>
<html>
<body>
<p>Display the value of Boolean(10 > 9):</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = Boolean(10 > 9);
Page 37 of 44
Question Bank
Class :
III BCOM (CA) A&B
Technology
}
</script>
Subject :
Sem :
Web Design
VI
</body>
</html>
NUMBER OBJECT
JavaScript has only one type of number.
Numbers can be written with, or without, decimals:
Example
var x = 3.14; // A number with decimals
var y = 34;
// A number without decimals
Extra large or extra small numbers can be written with scientific (exponent) notation:
Example
var x = 123e5; // 12300000
var y = 123e-5; // 0.00123
Program
<!DOCTYPE html>
<html>
<body>
<p>Floating point arithmetic is not always 100% accurate.</p>
<p>But it helps to multiply and divide.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = (0.2*10 + 0.1*10) / 10;
document.getElementById("demo").innerHTML = "0.2 + 0.1 = " + x;
}
</script>
</body>
</html>
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
<!DOCTYPE html>
<html>
<body>
<p>The sort() method sorts an array alphabetically.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
var fruits = ["Banana", "Orange", "Apple", "Mango"];
document.getElementById("demo").innerHTML = fruits;
function myFunction() {
fruits.sort();
document.getElementById("demo").innerHTML = fruits;
}
</script>
</body>
</html>
Reversing an Array
The reverse() method reverses the elements in an array.
You can use it to sort an array in descending order:
Example
<!DOCTYPE html>
<html>
<body>
<p>The sort() method sorts an array alphabetically.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
var fruits = ["Banana", "Orange", "Apple", "Mango"];
document.getElementById("demo").innerHTML = fruits;
Page 39 of 44
Question Bank
Class :
III BCOM (CA) A&B
Subject :
Technology
Sem :
VI
function myFunction() {
fruits.sort();
fruits.reverse();
document.getElementById("demo").innerHTML = fruits;
}
</script>
Web Design
</body>
</html>
Unit V
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
function myFunction() {
alert("Page is loaded");
}
</script>
</head>
<body onload="myFunction()">
<h1>Hello World!</h1>
</body>
</html>
2. Explain the concept of OnMousemove and OnMouseover event in detail
Answer
<!DOCTYPE html>
<html>
<head>
<script>
function myFunction(e) {
x = e.clientX;
y = e.clientY;
coor = "Coordinates: (" + x + "," + y + ")";
document.getElementById("demo").innerHTML = coor
}
function clearCoor() {
document.getElementById("demo").innerHTML = "";
}
</script>
</head>
<body style="margin:0px;">
Page 41 of 44
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
<p>Mouse over the rectangle above, and get the coordinates of your mouse pointer.</p>
<p id="demo"></p>
</body>
</html>
3. Explain the concept OnMouseout and OnFocus event in detail
Answer
<!DOCTYPE html>
<html>
<body>
<h1 onmouseover="style.color='red'" onmouseout="style.color='black'">Mouse over this
text</h1>
</body>
</html>
OnFocus
<!DOCTYPE html>
<html>
<head>
<script>
function myFunction(x) {
x.style.background = "yellow";
}
</script>
</head>
<body>
Enter your name: <input type="text" onfocus="myFunction(this)">
Page 42 of 44
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
<p>When the input field gets focus, a function is triggered which changes the backgroundcolor.</p>
</body>
</html>
4. Explain the concept Onblur and OnSubmit event in detail
Answer
OnBlur
<!DOCTYPE html>
<html>
<head>
<script>
function myFunction() {
var x = document.getElementById("fname");
x.value = x.value.toUpperCase();
}
</script>
</head>
<body>
Enter your name: <input type="text" id="fname" onblur="myFunction()">
<p>When you leave the input field, a function is triggered which transforms the input text to
upper case.</p>
</body>
</html>
OnSubmit
<!DOCTYPE html>
<html>
<head>
Page 43 of 44
Question Bank
Class :
III BCOM (CA) A&B
Technology
Subject :
Sem :
Web Design
VI
<script>
function confirmInput() {
fname = document.forms[0].fname.value;
alert("Hello " + fname + "! You will now be redirected to www.w3Schools.com");
}
</script>
</head>
<body>
<form onsubmit="confirmInput()" action="http://www.w3schools.com/">
Enter your name: <input id="fname" type="text" size="20">
<input type="submit">
</form>
</body>
</html>
5. Explain all the event handlers and its properties in detail.
Answer
Explanation
Page 44 of 44