LAB File
LAB File
<!DOCTYPE html>
<html>
<head>
<title>HTML bold Text</title>
</head>
<body>
<!--Normal text-->
<p>Hello</p>
<!--Text in Bold-->
<p>
<b>Hello</b>
</p>
<!--Text in Strong-->
<p>
<strong>Hello</strong>
</p>
<p>
</body>
</html>
OUTPUT
AIM : Use image tags to create a web page as per given sample.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>hyperlink</title>
</head>
<body>
<a href="https://www.google.co.in/"target="_blank">google </a>
</body>
</html>
OUTPUT
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>image tag</title>
</head>
<body>
<b></b><h1>The Image</b></h1>
<image src="KALYAN.jpg"alt="image not found"width="auto"height="auto"
</body>
</html>
OUTPUT
PRACTICAL-4
SWPD (4311603) Prepared By: Himani Mandaviya
AIM : UseUse HTML table tags to create web page.
<tr>
<tr>
<tr>
OUTPUT
PRACTICAL-5
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>sorted list</title>
</head>
<body>
<h1>KALYAN POLYTECHNIC COURSES</h1>
<!-- use sorted list to create web page -->
<ol type="I">
<li>diploma coures</li>
<li>b.voc</li>
<li>b.sc</li>
<li>yoga course</li>
</ol>
</body>
</html>
OUTPUT
PRACTICAL-6
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>sorted list</title>
</head>
<body>
<h1>KALYAN POLYTECHNIC COURSES</h1>
<!-- use unsorted list to create web page -->
<ol type="I">
<li>diploma coures</li>
<li>b.voc</li>
<li>b.sc</li>
<li>yoga course</li>
</ol>
</body>
</html>
OUTPUT
PRACTICAL-7
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Definition list</title>
</head>
<body>
<dl>
<dt><B>HTML</B></dt>
<dd>Hyper text markup language </dd>
<dt><b>POP</b></dt>
<dd>procedure oriented programming </dd>
<dt><b>boop</b></dt>
<dd>basic object orianted programming</dd>
</dl>
</body>
</html>
OUTPUT
PRACTICAL-8
A semantic element clearly describes its meaning to both the browser and the developer.
semantic elements: <form>, <table>, and <article> - Clearly defines its content.
Semantic Elements in HTML
Many web sites contain HTML code like: <div id="nav"> <div class="header"> <div id="footer"> to
indicate navigation, header, and footer.
In HTML there are some semantic elements that can be used to define different parts of a web page:
● <article>
● <aside>
● <details>
● <figcaption>
● <figure>
● <footer>
● <header>
● <main>
● <mark>
● <nav>
● <section>
● <summary>
● <time>
PRACTICAL-9(a)
<Html>
<head>
<title>
Registration Page
</title>
</head>
<body bgcolor="Lightskyblue">
<br>
<br>
<form>
<label> Firstname </label>
<input type="text" name="firstname" size="15"/> <br> <br>
<label> Middlename: </label>
<input type="text" name="middlename" size="15"/> <br> <br>
<label> Lastname: </label>
<input type="text" name="lastname" size="15"/> <br> <br>
<label>
Course :
</label>
<select>
<option value="Course">Course</option>
<option value="BCA">BCA</option>
<option value="BBA">BBA</option>
<option value="B.Tech">B.Tech</option>
<option value="MBA">MBA</option>
<option value="MCA">MCA</option>
<option value="M.Tech">M.Tech</option>
</select>
<br>
<br>
<label>
Phone :
</label>
<input type="text" name="country code" value="+91" size="2"/>
<input type="text" name="phone" size="10"/> <br> <br>
Address
<br>
<textarea cols="80" rows="5" value="address">
</textarea>
<br> <br>
Email:
<input type="email" id="email" name="email"/> <br>
<br> <br>
Password:
<input type="Password" id="pass" name="pass"> <br>
<br> <br>
Re-type password:
<input type="Password" id="repass" name="repass"> <br> <br>
<input type="button" value="Submit"/>
</form>
</body>
</html>
AIM : Create student feedback form using different HTML form elements.
<HTML>
<HEAD>
<TITLE>Feedback Form</TITLE>
</HEAD>
<BODY>
<H1>Feedback Form</H1>
<FORM action="mailto:[email protected]" method="post" enctype="text/plain">
First Name : <INPUT type="text" name="firstname" placeholder="Enter name here">
Second Name : <INPUT type="text" name="secondname" placeholder="Enter surname here">
<BR>
<BR>
<!--It's important that both of these radio button have the same name so they behave as one
component (i.e. Only one can be selected at a time)-->
<INPUT type="radio" name="gender" value="male">Male<BR>
<INPUT type="radio" name="gender" value="female">Female
<BR>
<BR>
<!--This uses the new HTML "email" INPUT type which will automatically validates the email
address when the SUBMIT button is clicked-->
email: <INPUT type="email" name="mail" placeholder="e-mail address">
<BR>
<BR>
Comment :<BR>
<TEXTAREA rows="6" cols="50" name="commen tfield"></TEXTAREA>
<BR>
<SELECT name="countychooser">
<OPTION value="cork">Cork</OPTION>
<OPTION value="dublin">Dublin</OPTION>
<OPTION value="galway">Galway</OPTION>
<OPTION value="kerry">Kerry</OPTION>
</SELECT>
<BR>
OUTPUT
AIM : Create a bank account opening form using different HTML form elements in
Kompozer.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Digital Form</title>
</head>
<body>
<div class="container">
<h1 class="main-header">Account Application Form.</h1>
<hr>
<form id="app-form" action="">
<fieldset class="sub-container" id="basic-details">
<h2 class="sub-heading">Basic Details</h2>
<hr>
<label for="dropdown" class="standard-label">
Title<span class="required">*</span>
<br>
<select id="dropdown" class="standard-select" required>
<option value="select" disabled selected>Select Title</option>
<option value="Mr">Mr</option>
<option value="Mrs">Mrs</option>
<option value="Miss">Miss</option>
<option value="Ms">Ms</option>
<option value="Dr">Dr</option>
<option value="Prof">Prof</option>
</select>
</label>
<label for="firstname" class="standard-label">
First Name<span class="required">*</span>
placeholder="Middle names...">
</label>
<label for="lastname" class="standard-label">
Last Name<span class="required">*</span>
<input class="standard-input" name="lastname" id="lastname" type="text"
address..." required>
</label>
<label for="DOB" class="standard-label">
Date of Birth<span class="required">*</span>
<input class="standard-input" type="date" name="DOB" id="DOB" required>
</label>
<label for="accounttype" class="standard-label">
AIM : Use inline, internal and external style sheets for the student registration form OR
bank account form created in previous practical.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body{
font-family: Calibri, Helvetica, sans-serif;
background-color: pink;
}
.container {
padding: 50px;
background-color: lightblue;
}
<label for="psw"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="psw" required>
OUTPUT
AIM :Use different CSS elements to create and format your Profile Page (Note: use CSS
Background, Text, Font, Tables, Links,Images, Margin etc)
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
color: blue;
font-family: verdana;
font-size: 300%;
}
p{
color: red;
font-family: courier;
font-size: 160%;
}
p{
border: 2px solid powderblue;
margin: 50px;
SWPD (4311603) Prepared By: Himani Mandaviya
}
</style>
</head>
<body>
<h1>Himani Mandaviya</h1>
<p>Kalyan Polytechnic College</p>
<p>Ad.hoc Lecturer (Computer Department)</p>
<p>Sem :2 </p>
<p>Subject: Static Web Page Design</p>
</body>
</html>
OUTPUT
AIM :Create and format your class time table Page Using Different CSS Elements
#sub {
color: black;
font-family: sans-serif;
font-weight: 400;
background-color: #ffffff;
}
#sub1 {
background-color: #fff;
}
#sub2 {
color: black;
text-transform: uppercase;
background-color: #ffffff;
HTML CODE:
<!DOCTYPE html>
<html lang="en">
<head>
<title>time table</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/style.css">
</style>
</head>
<body>
<header>
<h1>COLLEGE TIME TABLE</h1>
</header>
<table>
<thead>
<tr>
<td id="sub1"> </td>
<td id="sub">8:30-9:30</td>
<td id="sub">9:30-10:30</td>
<td id="sub">10:30-11:30</td>
<td id="sub">11:30-12:30</td>
<td id="sub">12:30-2:00</td>
<td id="sub">2:00-3:00</td>
<td id="sub">3:00-4:00</td>
<td id="sub">4:00-5:00</td>
</tr>
</thead>
<tbody>
<td id="box2">SUB2</td>
<td id="sub2">library</td>
</tr>
<tr>
<td id="sub">WEDNESDAY</td>
<td id="box1">SUB1</td>
<td id="box2">SUB2</td>
<td id="box5">SWA</td>
<td id="blank">---</td>
<td colspan="3"id="sub3" >LAB</td>
</tr>
<tr>
<td id="sub">THURSDAY</td>
<td id="box1">SUB1</td>
<td id="box2">SUB2</td>
<td id="box3">SUB3</td>
<td id="blank">---</td>
<td id="box5">SUB5</td>
<td id="sub2">library</td>
</tr>
</tbody>
</table>
</body>
</html>
OUTPUT
AIM :Use JavaScript to perform the following operations: find roots of quadratic equation
OUTPUT
PRACTICAL-13(b)
AIM : Use JavaScript to find the highest from given three values
// Example usage
const largestNumber = findLargest(10, 5, 8);
console.log("Largest number:", largestNumber);
OUTPUT
PRACTICAL-14
AIM : Use JavaScript to check whether a given character is vowel or consonant using if else
ladder.
function checkChar(char){
ch = char.toLowerCase();
if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u')
return console.log("Given character is a Vowel");
return console.log("Given character is a Consonent");
}
OUTPUT
PRACTICAL-15
AIM : Use JavaScript to check whether a given character is vowel or consonant using switch
case.
function isVowel(ch)
{
var check = 0;
switch (ch) {
case 'a':
OUTPUT
PRACTICAL-16
function first10Even() {
let cnt = 0;
let number = 0;
while (cnt < 10) {
if (number % 2 === 0) {
cnt++;
OUTPUT
PRACTICAL-17
// Power input
let power = 3
// Display output
console.log(num);
OUTPUT
PRACTICAL-18
let n = 5;
for (let i = 1; i <= 10; ++i)
console.log(n + " * " + i +
OUTPUT
PRACTICAL-19(a)
AIM : Use JavaScript user defined functions to perform the following operations: to calculate
sum of 1 to n
// Driver code
const n = 5;
console.log(findSum(n));
OUTPUT
PRACTICAL-19(b)
AIM :Use JavaScript user defined functions to perform the following to check whether given
number is prime or not
// corner cases
if (n == 0 || n == 1) {
return false;
}
// Checking Prime
if (n == i) return true;
// base cases
if (n % i == 0) {
return false;
}
i++;
return isPrime(n);
}
// Driver Code
isPrime(35) ? document.write(" true\n") : document.write(" false\n");
OUTPUT
PRACTICAL-20(a)
AIM : Use JavaScript to perform the following operations: take input of student name
and address and display in a dialog box.
<html>
<head>
<script type = "text/javascript">
function fun() {
SWPD (4311603) Prepared By: Himani Mandaviya
prompt ("This is a prompt box", "Himani Mandaviya, Jamnagar");
}
</script>
</head>
<body>
<p> Click the following button to see the effect </p>
<form>
<input type = "button" value = "Click me" onclick = "fun();" />
</form>
</body>
</html>
OUTPUT
PRACTICAL-20(b)
AIM : Use JavaScript to perform the following operations:change background color of webpage as
selected by user from a list of colors given in combo box.
Use JavaScript to perform the following operations: calculate the factorial of a given number
entered into a textbox.Display the result in another textbox.
<!DOCTYPE html>
<html>
<head>
</head>
SWPD (4311603) Prepared By: Himani Mandaviya
<body style = "text-align: center; font-size: 20px;">
<h1> Welcome to Factorial Operations</h1>
Enter a number: <input id = "num">
<br><br>
<button onclick = "fact()"> Factorial </button>
<p id = "res"></p>
<script>
function fact(){
var i, num, f;
f = 1;
num = document.getElementById("num").value;
for(i = 1; i <= num; i++)
{
f = f * i;
}
i = i - 1;
document.getElementById("res").innerHTML = "The factorial of the number " + i + " is: " + f ;
}
</script>
</body>
</html>
OUTPUT
<!DOCTYPE html>
<html>
<body>
<script type="text/javascript">
function multiply(){
a=Number(document.my_cal.first.value);
b=Number(document.my_cal.second.value);
c=a*b;
document.my_cal.total.value=c;
}
function addition(){
a=Number(document.my_cal.first.value);
b=Number(document.my_cal.second.value);
c=a+b;
document.my_cal.total.value=c;
}
function subtraction(){
a=Number(document.my_cal.first.value);
b=Number(document.my_cal.second.value);
c=a-b;
document.my_cal.total.value=c;
}
function division(){
a=Number(document.my_cal.first.value);
b=Number(document.my_cal.second.value);
c=a/b;
document.my_cal.total.value=c;
}
function modulus(){
a=Number(document.my_cal.first.value);
<br><br>
<input type="button" value="ADD" onclick="javascript:addition();">
<input type="button" value="SUB" onclick="javascript:subtraction();">
<input type="button" value="MUL" onclick="javascript:multiply();">
<input type="button" value="DIV" onclick="javascript:division();">
<input type="button" value="MOD" onclick="javascript:modulus();">
<br><br>
<!-- Here result will be displayed. -->
Get Result: <input type="text" name="total">
</body>
</html>
OUTPUT