You are on page 1of 10

3. Define <p>, <br>, <i>, <h1> tags.

<p>: The HTML <p> element defines a paragraph.


Example: <p>this is a paragraph</p>
<br>: <br> Defines a single line break
Example: <h1> this is Heading tag</h1><br>
<h2> this is another Heading tag </h2>.
<h1>: The <h1> element defines a heading.
Example: <h1>My First Heading</h1>
<i>: <i> Defines italic text.
Example: <i> this is italic tag</i>
4. Describe BODY tag with attributes.
Body Tag:. The main body of an HTML document where all of the content is placed. You
must use this element and it should be used just once. It must start immediately after the
closing head tag and end directly before the closing html tag.
Body Tag Attributes:
bgcolor: The bgcolor attribute controls the background color of the page.
Example: <body bgcolor=yellow>
Or
<body bgcolor=#FFFF00>

background: The background attribute allows you to place a picture or


image in the background of your page.
Example: <body background=name.jpg>

text: The text attribute sets the color for all the text on the page except
the text enclosed in an anchor <a> container and text that is under the
influence of a style that specifies color.
Example: < body background=name.jpg text=#FFFF00>

Link color change:


The following three attributes allow you to control the color of links:
alink: Specifies the color of the active link or the link that is being
targeted by the mouse.

link: specifies the color of all the hyperlinks the user has not yet followed.

vlink: specifies the color of all the links the user has already followed or
visited at one time or another and that are kept in the browsers history.

5. Write HTML code for the following output.


i) (a+b)2=a2+2ab+b2
miles per hour.

ii) H2+SO4= H2SO4 iii) A speed limit of 45 55

i)
<html>
<body>
(a+b)<sup>2</sup>=a<sup>2</sup>+2ab+b<sup>2</sup><br>
</body>
</html>
ii)
<html>
<body>
H<sub>2</sub>+SO<sub>4</sub>=H<sub>2</sub>SO<sub>4</sub
>

</body>
</html>

iii)
<html>
<body>
A speed limit of <del>45</del>
<ins>55</ins>miles per hour.
</body>
</html>

6. Define anchor tags with example.


Anchor Tags: The text that appears highlighted in a hypertext link and that
can be clicked to open the target web page.
Example:
<html>
<body>
<a href="lastpage.htm">Last page</a>
</body>
</html>
7. What is JavaScript? What can a JavaScript Do?

JavaScript was designed to add interactivity to HTML pages

JavaScript is a scripting language


A scripting language is a lightweight programming language
A JavaScript consists of lines of executable computer code

A JavaScript is usually embedded directly into HTML pages


JavaScript is an interpreted language (means that scripts execute without preliminary
compilation)
Everyone can use JavaScript without purchasing a license
What can a JavaScript Do?

JavaScript gives HTML designers a programming tool - HTML authors are


normally not programmers, but JavaScript is a scripting language with a very simple
syntax.

JavaScript can put dynamic text into an HTML page - A JavaScript statement like
this: document.write("<h1>" + name + "</h1>") can write a variable text into an
HTML page

JavaScript can react to events - A JavaScript can be set to execute when something
happens, like when a page has finished loading or when a user clicks on an HTML
element

JavaScript can read and write HTML elements - A JavaScript can read and change
the content of an HTML element

JavaScript can be used to validate data - A JavaScript can be used to validate form
data before it is submitted to a server. This saves the server from extra processing

JavaScript can be used to detect the visitor's browser - A JavaScript can be used to
detect the visitor's browser, and - depending on the browser - load another page
specifically designed for that browser

JavaScript can be used to create cookies - A JavaScript can be used to store and
retrieve information on the visitor's computer

8. Describe different types JavaScript Popup Boxes with example.


In JavaScript we can create three kinds of popup boxes: Alert box, Confirm box, and Prompt
box.
Alert Box
An alert box is often used if you want to make sure information comes through to the user.
When an alert box pops up, the user will have to click "OK" to proceed.
Syntax:
alert("sometext");

Confirm Box
A confirm box is often used if you want the user to verify or accept something.
When a confirm box pops up, the user will have to click either "OK" or "Cancel" to proceed.
If the user clicks "OK", the box returns true. If the user clicks "Cancel", the box returns false.
Syntax:
confirm("sometext");

Prompt Box
A prompt box is often used if you want the user to input a value before entering a page.
When a prompt box pops up, the user will have to click either "OK" or "Cancel" to proceed
after entering an input value.
If the user clicks "OK" the box returns the input value. If the user clicks "Cancel" the box
returns null.
Syntax:
prompt("sometext","defaultvalue");

9. Define VBScript variables. Declaring variables.

VBScript Variables
Variable is a named memory location used to hold a value that can be changed during the
script execution. VBScript has only ONE fundamental data type, Variant.
Rules for Declaring Variables:
Variable Name must begin with an alphabet.
Variable names cannot exceed 255 characters.
Variables Should NOT contain a period (.)
Variable Names should be unique in the declared context.
Declaring Variables
Variables are declared using dim keyword. Since there is only ONE fundamental data type,
all the declared variables are variant by default. Hence, a user NEED NOT mention the type
of data during declaration.

Example 1: In this Example, Int Value can be used as a String, Integer or even arrays.
Dim Var
Example 2: Two or more declarations are separated by comma(,)
Dim Variable1,Variable2
10. Define with example: a) onclick () b) onchange (), c)OnSubmit, d) OnMouseOver
and OnMouseOut.
OnClick-Every element on a web page has certain events which can trigger JavaScript
functions.
For example, we can use the on Click event of a button element to indicate that a function
will run when a user clicks on the button. We define the events in the HTML tags.
<html>
<head>
<script type="text/javascript">
function sayHello()
{
alert("Hello World")
}
</script>
</head>
<body>
<input type="button" onclick="sayHello()" value="Say Hello" />
</body>
</html>
OnChange
onChange events are often used in combination with validation of form fields.
Below is an example of how to use the onChange event. The checkEmail() function will be
called whenever the user changes the content of the field:
<html>
<head>
<script type="text/javascript">
function sayHello()
{
alert("Hello World")
}
</script>
</head>
<body>
<input type="text" size="30" id="email" onchange="checkEmail()">
</body>
</html>
OnSubmit:

The onSubmit event is used to validate ALL form fields before submitting it.
Below is an example of how to use the onSubmit event. The checkForm() function will be
called when the user clicks the submit button in the form. If the field values are not accepted,
the submit should be cancelled. The function checkForm() returns either true or false. If it
returns true the form will be submitted, otherwise the submit will be cancelled:
<form method="post" action="abc.htm" onsubmit="return checkForm()">
OnMouseOver and OnMouseOut:
onMouseOver and onMouseOut are often used to create "animated" buttons.
Below is an example of an onMouseOver event. An alert box appears when an onMouseOver
event is detected:
<a href="http://www.schools.com"onmouseover="alert('An onMouseOver event');return
false">
<img src="schools.gif" width="100" height="30"></a>

11. What is ASP? How Does ASP Differ from HTML?


ASP(Active Server Pages)

ASP stands for Active Server Pages

ASP is a Microsoft Technology

ASP is a program that runs inside IIS

IIS stands for Internet Information Services

IIS comes as a free component with Windows 2000

IIS is also a part of the Windows NT 4.0 Option Pack

The Option Pack can be downloaded from Microsoft

PWS is a smaller - but fully functional - version of IIS

PWS can be found on your Windows 95/98 CD

How Does ASP Differ from HTML?

When a browser requests an HTML file, the server returns the file

When a browser requests an ASP file, IIS passes the request to the ASP engine. The
ASP engine reads the ASP file, line by line, and executes the scripts in the file.
Finally, the ASP file is returned to the browser as plain HTML

12. Explain how to use VBScript in ASP.


When VBScript is used on a web server, with ASP, the statement response.write() produces
output.

Example:
<html>
<body>
<%response.write("This is my first VBScript")%>
</body>
</html>

13. Write the rules for VBScript variable names.


VBScript Variables:
As with algebra, VBScript variables are used to hold values or expressions.
A variable can have a short name, like x, or a more descriptive name, like carname.
Rules for VBScript variable names:
Must begin with a letter
Cannot contain a period (.)
Cannot exceed 255 characters

14. Describe text field with example.

Text fields are one line areas that allow the user to input text.
Settings:
Below is a listing of valid settings for text fields:

HTML

EXPLANATION

EXAMPLE

text
size=
maxlength=
name=
value=
align=
tabindex=

One line text field


Characters shown.
Max characters allowed.
Name of the field.
Initial value in the field.
Alignment of the field.
Tab order of the field.

Size: The size option defines the width of the field. That is how many visible characters it can
contain.
Maxlength: The maxlength option defines the maximum length of the field. That is how
many characters can be entered in the field.
If you do not specify a maxlength, the visitor can easily enter more characters than are visible
in the field at one time.
Name: The name setting adds an internal name to the field so the program that handles the
form can identify the fields.
Value: The value setting defines what will appear in the box as the default value.
Align: The align setting defines how the field is aligned.
Valid entries are: TOP, MIDDLE, BOTTOM, RIGHT, LEFT, The alignments are explained in
the image section.
Tabindex: The tabindex setting defines in which order the different fields should be
activated when the visitor clicks the tab key.
AN EXAMPLE:
Look at this HTML example:
<html>
<head>
<title>My Page</title>
</head>
<body>
<form name="myform" action="http://www.domain.com/myformhandler.php"
method="POST">
<div align="center"><br>
<input type="text" size="25" value="Enter your name here!"><br>
</div>
</form>
</body>
</html>

And the resulting output from it:

15. Write HTML code for the following output:

Username:

Password:
Log In

NEW USERS: SIGN UP HERE!


FORGOT YOUR PASSWORD?

You might also like