Web Programs 6th Sem
Web Programs 6th Sem
<ol>
<li> CAT </li>
<li> DOG</li>
<li> PIG </li>
</ol
<dl>
<dt> coffee </dt>
<dd> black hot drink </dd>
<dt>milk </dt>
<dd> white cold drink </dd>
</dl>
</body>
</html>
Forms.html
<html>
<head>
<title> Registration Form </title>
</head>
<body >
<form name ="myform">
<h1> Contact US </h1>
<table>
<tr>
<td style = "color: green; font-size: 30; font-weight:bold"> Name: </td>
<td> <input type = "text" size = "50" maxlength = "50"/> </td>
</tr>
<tr>
<td> EMAIL: </td>
<td> <input type = "password" size = "50" maxlength = "250"/> </td>
</tr>
<tr>
<td> About Yourself: </td>
<td> <textarea cols="100" rows ="10"></textarea> </td>
</tr>
<tr>
<td> Languages Known : </td>
<td><label>C++ <input type = "checkbox" checked = "checked" value = "C++"/> </label></td>
</tr>
<tr>
<td> </td>
<td style = "font-size:10"><label> <input type = "checkbox" value = "C" />C </label> </td>
</tr>
<tr>
<td> </td>
<td><label> <input type = "checkbox" value = "Java"/>JAVA </label> </td>
</tr>
<tr>
<td> </td>
<td><label> <input type = "checkbox" value = "Python"/>Python </label> </td>
</tr>
<tr>
<td> </td>
<td><label> <input type = "radio" value = "BCA"/>BCA </label> </td>
</tr>
<tr>
<td> </td>
<td><label> <input type = "radio" value = "BSC"/>BSC </label> </td>
</tr>
<tr>
<td> How did you know about us? </td>
<td>
<select>
<option> GOOGLE </option>
<option value= "add"> Local newspaper add
</option>
<option value= "friend"> Friend </option>
<option value= "TV"> Television adds </option>
<option value= "other"> OTHERS </option>
</td>
</tr>
<tr>
<td> Newsletter </td>
<td> <input type = "checkbox" checked="checked" />
Ensure this box is checked if you would like to recieve email updates
</td>
</tr>
</table>
</form>
</body>
</html>
4. write a html code to create a document with paragraph, preformatted
text, image, hyperlinks
<html>
<body>
<h1>Web Programming</h1>
<h2>Web Programming</h2>
<h3>Web Programming</h3>
<h4>Web Programming</h4>
<h5>Web Programming</h5
<h6>Web Programming</h6>
<pre>
The official journey of Azadi Ka Amrit Mahotsav commenced on
March 12, 2021, which started a 75-week countdown to the 75th anniversary of
India's independence and will end post a year on August 15, 2023
<pre>
home.html
<html>
<head>
<link rel="stylesheet" href="styles.css">
<style>. (External styling)
body {background-color: powderblue;}
h2 {color: blue;}
h5 {color: red;}. (Internal styling)
</style>
</head>
<body>
<h1>Web Programming</h1>
<h2>Web Programming</h2>
<h3>Web Programming</h3>
<h4>Web Programming</h4>
<h5>Web Programming</h5
<h6>Web Programming</h6>
<h1 style="color:blue;">A Blue Heading</h1>
<p style="color:red;">A red paragraph.</p>
</body>. (Inline styling)
</html>
<tr>
<td> About Yourself: </td>
<td> <textarea cols="100" rows ="10"></textarea> </td>
</tr>
<tr>
<td> Languages Known : </td>
<td><label>C++ <input type = "checkbox" checked = "checked"
value = "C++"/> </label>
</td>
</tr>
<tr>
<td> </td>
<td style = "font-size:10"><label> <input type = "checkbox" value =
"C" />C </label>
</td>
</tr>
<tr>
<td> </td>
<td><label> <input type = "checkbox" value = "Java"/>JAVA </label>
</td>
</tr>
<tr>
<td> </td>
<td><label> <input type = "checkbox" value = "Python"/>Python
</label>
</td>
</tr>
<tr>
<td> </td>
<td><label> <input type = "radio" value = "BSC"/>BSC </label> </td>
</tr>
<tr>
<td> How did you know about us? </td>
<td>
<select>
<option> GOOGLE </option>
<option value= "add"> Local newspaper add </option>
<option value= "friend"> Friend </option>
<option value= "TV"> Television adds </option>
<option value= "other"> OTHERS </option>
</td>
</tr>
<tr>
<td> Newsletter </td>
<td> <input type = "checkbox" checked="checked" />
Ensure this box is checked if you would like to recieve email updates </td>
</tr>
</table>
<input type ="submit" value="Send Message" onclick = "countformelements()"/>
</form>
</body>
</html>
<script>
function factorial(x){
if(x===0)
return 0;
else if(x===1)
return 1;
else
return x * factorial(x-1);
}
</script>
</head>
<body>
</body>
</html>
</head>
</html>
<body>
<form>
Enter any expression : <input type = "text" id = "exp"/> <br/> <br/> <br/>
<input type = "button" value = "evaluate" onclick = "evaluate111()"/> <br/> <br/> <br/>
Result of expression : <input type = "text" id = "result"/>
</form>
</body>
</html>
document.writeln("</table>");
}
</script>
</head>
<body>
<form>
<table>
<tr> <td> EMPLOYEE NAME </td> <td> <input type = "text" id ="name" /> </td> </tr> </br>
<tr> <td> EMPLOYEE NUMBER </td> <td> <input type = "text" id ="empno" /> </td>
</tr> </br>
<tr> <td> BASIC PAY </td> <td> <input type = "text" id ="basic" /> </td> </tr>
<tr> <td> </td> <td> <input type = "button" value ="Submit" onClick="cal_pay()"/> </td>
</tr>
</table>
</form>
</body>
</html>
10. Write a HTML program to calculate average marks and grade student
<html>
<head>
<script type="text/javascript">
function cal_average(){
var name = document.getElementById("name").value;
var m1 = parseInt(document.getElementById("m1").value);
var m2 = parseInt(document.getElementById("m2").value);
var m3 = parseInt(document.getElementById("m3").value);
var avg = (m1+m2+m3)/ 3;
}
</script>
</head>
<body>
<form>
<table>
<tr> <td> NAME </td> <td> <input type = "text" id ="name" /> </td> </tr> </br>
<tr> <td> COURSE </td> <td> <input type = "text" id ="COURSE" /> </td> </tr>
</br>
<tr> <td> INTERNAL MARKS 1 </td> <td> <input type = "text" id ="m1" /> </td> </tr>
<tr> <td> INTERNAL MARKS 2</td> <td> <input type = "text" id ="m2" /> </td> </tr>
<tr> <td> INTERNAL MARKS 3</td> <td> <input type = "text" id ="m3" /> </td> </tr>
<tr> <td> </td> <td> <input type = "button" value ="Submit" onClick="cal_average()"/> </td>
</tr>
</table>
</form>
</body>
</html>
<script>
function save(){
var usermsg;
if (confirm("Do you want to save changes?") == true) {
usermsg = "Data saved successfully!";
} else {
usermsg = "Save Canceled!";
}
document.getElementById("msg").innerHTML =usermsg;
}
function displayInfo(){
alert("This is an alert message box."); // display string message
alert('This is a numer: ' + 100); // display result of a concatenation
alert(100); // display number
alert(Date()); // display current date
}
function myinput(){
var name = prompt("Enter Your Name:");
</script>
</body>
</html>
12. Write a JAvascript program to perform arithmetic operations
<!doctype html>
<html>
<head>
<script>
var numOne, numTwo, res, temp;
function fun()
{
numOne = parseInt(document.getElementById("one").value);
numTwo = parseInt(document.getElementById("two").value);
if(numOne && numTwo)
{
temp = document.getElementById("res");
temp.style.display = "block";
res = numOne + numTwo;
document.getElementById("add").value = res;
res = numOne - numTwo;
document.getElementById("subtract").value = res;
res = numOne * numTwo;
document.getElementById("multiply").value = res;
res = numOne / numTwo;
document.getElementById("divide").value = res;
}
else {
alert("enter both the numbers");
}
}
</script>
</head>
<body>
function findcost(){
var major =document.getElementById("major");
var starters =document.getElementById("starters");
var soft =document.getElementById("soft");
</script>
</head>
<body>
<form name ="menuForm">
<table border = "10">
<tr> <th colspan ="2" align ="center"> <h2> Restaurant Menu Details </h2></th> </tr>
<tr>
<td> Major Dishes </td>
<td>
<select id ="major" size ="3" >
<option value="100"> Vegetable pulav- Rs.100 </option>
<option value="150"> Biriyani- Rs. 150 </option>
<option value="50"> Roti Curry - Rs.50</option>
</select>
</td>
</tr>
<tr>
<td> Starters </td>
<td>
<select id ="starters" size ="3" multiple ="multiple">
<option value="100"> Gobi Manchurian </option>
<option value="150"> Veg Clear Soup </option>
<option value="50"> MAsala Papad </option>
</select>
</td>
</tr>
<tr>
<td> Soft Drinks </td>
<td>
<select id ="soft" size ="3" multiple ="multiple">
<option value="20"> Pepsi </option>
<option value="15"> Sprite </option>
<option value="50"> Lime Soda </option>
</select>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<textarea id="ordereditems" rows="10" cols="40"></textarea>
</td>
</tr>
<tr>
<td> <input type="button" value="Find Total Cost" onclick="findcost()"/> </td>
<td> <input type="reset" value="Clear"/> </td>
</tr>
</table>
</form>
</body>
</html>
document.getElementById("two").value = sum;
}
</script>
</head>
<body>
15. Write a javascript program to dynamically change background and foreground colors
<html>
<head>
<title> Color demonstration </title>
<script>
function changeColor(whatToChange, newColor){
if(whatToChange=="background")
document.body.style.backgroundColor = newColor;
else
document.body.style.color=newColor;
}
</script>
</head>
<body>
<p> This is a simple paragraph </p> <br/>
<form>
<label> Enter Foreground color : </label>
<input type="text" onchange="changeColor('foreground', this.value)"/> <br/><br/>
<label> Enter Backgound color : </label>
<input type="text" onchange="changeColor('background', this.value)"/> <br/><br/>
</form>
</body>
</html>