Main HTML Project
Main HTML Project
TABLE OF CONTENTS
HEAD: Information placed in this section is essential to the inner workings of the document. It
has nothing to do with contents of the document. All information placed within
<HEAD></HEAD> tags is not displayed in the browser, with the exception of information
contained within the <TITLE></TITLE> tags. The HTML tags used to indicate the start and end of
the head section are:
<HEAD>
<TITLE>---</TITLE>
</HEAD>
TITLE: A Web page could have a title that describes what the page is about without being too
wordy. This can be done by using the TITLE tag. Text included between the <TITLE>---</TITLE>
tag shows up in the title bar of the browser window.
<Html>
<Head>
</head>
</html>
BODY: The tag is used to indicate the start and end of the main body of textual information are:
<Html>
<Head>
<Title>CPJ College</title>
</head>
Page | 2
WEB DESIGNING
<Body>
Hello Friends
</body>
</html>
EXERCISE-1
WAP to design <HTML> web page?
<Html>
Page | 3
WEB DESIGNING
<Head>
</head>
<Body>
<h4>Web Page</h4>
<tr align="center">
<td colspan=3>Header</td>
</tr>
<tr align="center">
<td>Left</td>
<td>Body</td>
<td>Right</td>
</tr>
<tr align="center">
<td colspan=3>Footer</td>
</tr>
</table>
</body></html>
EXERCISE-2
WAP to design the formatted the text on the Web page?
(b.) <Pre>
Page | 4
WEB DESIGNING
(c.) <em>
(e.) <Font>
<Head>
</head>
<Body>
</body>
</html>
Sol (b):<Pre>
<Html>
<Head
<Body>
<Pre>
</pre>
</body>
</html>
<Html>
<Head>
</head>
<Body>
Page | 6
WEB DESIGNING
<h4>Emphasized Tag</h4>
<Em>
</em>
</body>
</html>
<Html>
<Head>
<Title>CPJ College</title>
Page | 7
WEB DESIGNING
</head>
<Body>
</body>
</html>
<Html>
<Head>
<Title>CPJ College</title>
</head>
<Body>
</html>
EXERCISE-3
Sol (a):
<Html>
Page | 9
WEB DESIGNING
<Head>
</head>
<Body>
<h4>List of Colleges</h4>
<ol>
<li>CPJ College</li>
<li>IIMT</li>
<li>JSS</li></ol>
</body>
</html>
(b)
<Html>
<Head>
</head>
<Body>
<h4>List of Colleges</h4>
Page | 10
WEB DESIGNING
<ul>
<li>CPJ College</li>
<li>IIMT</li>
<li>JSS</li>
</ul>
</body>
</html>
EXERCISE-4
WAP to add a graphics image on the Web Page?
Sol:
<Html>
<Head>
</head>
<Body>
</html>
EXERCISE-5
Cell1 Cell2
Cell3 Cell4
Sol:
<Html>
<Head>
</head>
Page | 12
WEB DESIGNING
<body style="background-color: lightgray ;">
<b>Design a table</b></br></br>
<tr>
<td>cell1</td>
<td>cell2</td>
</tr>
<tr>
<td>cell3</td>
<td>cell4</td>
</tr>
</table>
</body>
</html>
Page | 13
WEB DESIGNING
EXERCISE-6
WAP to create simple text field on an HTML page?
Sol:
<Html>
<Head>
Page | 14
WEB DESIGNING
<Title> Cpj College </title>
</head>
<Body>
</body>
</html>
EXERCISE-7
WAP to create password field on an HTML page?
Sol:
<Html>
<Head>
<Body>
</body>
</html>
EXERCISE-8
Sol:
<Html>
<Head>
Page | 16
WEB DESIGNING
</head>
<Body>
</body>
</html>
EXERCISE-9
Sol:
<Html>
<Head>
Page | 17
WEB DESIGNING
</head>
<Body>
</body>
</html>
EXERCISE-10
Sol:
<Html>
<Head>
</head>
Page | 18
WEB DESIGNING
<Body>
</body>
</html>
EXERCISE-11
Sol:
<Html>
<Head>
</head>
Page | 19
WEB DESIGNING
<Body>
<select name="college">
<option value="1">CPJCHS</option>
<option value="2">JSS</option>
<option value="3">IITM</option>
</select>
</body>
</html>
EXERCISE-12
WAP to create a text area using JavaScript on an HTML page?
Sol:
<Html>
<Head>
</head>
<Body>
</text area>
</body>
</html>
Sol:
<Html>
<Head>
</head>
<Body>
</body>
Page | 21
WEB DESIGNING
</html>
EXERCISE-14
WAP to create a registration form on an HTML page?
Sol:
<Html>
<Head>
<Title>Registration</title>
</head>
<Body>
Page | 22
WEB DESIGNING
<table border="1">
<tr>
<td>First name</td>
</tr>
<tr>
<td>Last name</td>
</tr>
<tr>
<td>Email</td>
</tr>
<tr>
<td>Address</td>
<td>
</textarea>
</td>
</tr>
<tr>
<td>college</td>
Page | 23
WEB DESIGNING
<td><select name="college">
<option value="1">CPJCHS</option>
<option value="2">JSS</option>
<option value="3">IITM</option>
</select>
</td>
</tr>
<tr>
</td>
</tr>
</table>
</body>
</html>
Page | 24
WEB DESIGNING
Sol:
<Html>
<Head>
Page | 25
WEB DESIGNING
<Title>CPJ College</title>
</head>
<Body>
<h1>Variable is :</h1>
<Script>
var x=2;
document.write(x);
</script>
</body>
</html>
EXERCISE-16
WAP to create an array of size 10 on an HTML page?
<html>
<head>
<title>CPJ College</title>
Page | 26
WEB DESIGNING
</head>
<body>
<script>
ar[0]=1;
ar[1]=2;
ar[2]=3;
ar[3]=4;
ar[4]=5;
document.write(ar[i]);
document.write("<br>");
</script>
</body>
</html>
EXERCISE-17
WAP to open a window using JavaScript on an HTML page?
Sol:
<Html>
<Head>
window.open("abc.html")
</script>
</head>
<body>
</body>
</html>
EXERCISE-18
WAP to close a window using JavaScript on an HTML page?
Sol:
<Html>
<Head>
Page | 28
WEB DESIGNING
<Script>
function winclose()
window.close("abc.html")
</script>
</head>
<Body>
</body>
</html>
EXERCISE-19
WAP to validate the user login using JavaScript on an HTML page?
Sol:
<Html>
<Head>
<Title>Login</title>
<Script>
Page | 29
WEB DESIGNING
Function log()
</script>
</head>
<Body>
<table border="1">
<tr>
<td>Name</td>
<td>
</td>
</tr>
<tr>
<td>Password</td>
<td>
</td>
</tr>
Page | 30
WEB DESIGNING
<tr>
</td>
</tr>
</table>
</body>
</html>
EXERCISE-20
WAP to create a web page using Math object in JavaScript?
<Html>
<Head>
</Head>
Page | 31
WEB DESIGNING
<Body>
<Script>
document.write (Math.abs(-15))
</script>
</body>
</html>
(b.) ceil () – Returns the next integer greater than or equal to a number
<Html>
<Head>
</Head>
<Body>
<Script>
Page | 32
WEB DESIGNING
document. Write (Math.ceil (15.45))
</script>
</body>
</html>
(c.) pow () – Calculates the value of one number to the power of a second number – takes two
arguments.
<Html>
<Head>
</Head>
<Body>
<Script>
Page | 33
WEB DESIGNING
Document.write(Math.pow(2,2))
</script>
</body>
</html>
EXERCISE-21
Sol:
<Html>
<Head>
<Title>CPJ College</title>
</head>
<Body>
Page | 34
WEB DESIGNING
<Script>
document.write(x);
</script>
</body>
</html>
Page | 35