Iwd Practical Assignments
Iwd Practical Assignments
<html>
<head><title> Student Registration Form </title></head>
<body>
<form action="#" name="StudentRegistration" onsubmit="#">
<tr>
<td>Name</td>
<td><input type=text name=textnames id="textname" size="30"></td>
</tr>
<tr>
<td>Father Name</td>
<td><input type="text" name="fathername" id="fathername"
size="30"></td>
</tr>
<tr>
<td>Postal Address</td>
<td><input type="text" name="paddress" id="paddress" size="30"></td>
</tr>
<tr>
<td>Personal Address</td>
<td><input type="text" name="personaladdress"
id="personaladdress" size="30"></td>
</tr>
<tr>
<td>Gender</td>
<td><input type="radio" name="sex" value="male" size="10">Male
<input type="radio" name="sex" value="Female" size="10">Female</td>
</tr>
<tr>
<td>City</td>
<td><select name="City">
<option value="-1" selected>select..</option>
<option value="New Delhi">NEW DELHI</option>
<option value="Mumbai">MUMBAI</option>
<option value="Goa">GOA</option>
<option value="Patna">PATNA</option>
</select></td>
</tr>
<tr>
<td>Course</td>
<td><select name="Course">
<option value="-1" selected>select..</option>
<option value="B.Tech">B.TECH</option>
<option value="MCA">MCA</option>
<option value="MBA">MBA</option>
<option value="BCA">BCA</option>
</select></td>
</tr>
<tr>
<td>District</td>
<td><select name="District">
<option value="-1" selected>select..</option>
<option value="Nalanda">NALANDA</option>
<option value="UP">UP</option>
<option value="Goa">GOA</option>
<option value="Patna">PATNA</option>
</select></td>
</tr>
<tr>
<td>State</td>
<td><select Name="State">
<option value="-1" selected>select..</option>
<option value="New Delhi">NEW DELHI</option>
<option value="Mumbai">MUMBAI</option>
<option value="Goa">GOA</option>
<option value="Bihar">BIHAR</option>
</select></td>
</tr>
<tr>
<td>PinCode</td>
<td><input type="text" name="pincode" id="pincode" size="30"></td>
</tr>
<tr>
<td>EmailId</td>
<td><input type="text" name="emailid" id="emailid" size="30"></td>
</tr>
<tr>
<td><label for="password">Password:</label></td>
<td><input id="password" maxlength="50" name="password"type="password" /></td>
</tr>
<tr>
<td>DOB</td>
<td><input type="text" name="dob" id="dob" size="30"></td>
</tr>
<tr>
<td>MobileNo</td>
<td><input type="text" name="mobileno" id="mobileno" size="30"></td>
</tr>
<tr>
<td><input type="reset"></td>
<td colspan="2"><input type="submit" value="Submit Form" /></td>
</tr>
</table>
</form>
</body>
</html>
2. Using HTML Generate your Time Table.
<html>
<head><title> Generate Time Table </title></head>
<body>
<table cellpadding="1" cellspacing="2" border="1" cellspacing="0" cellpadding="0"
bordercolor="#0000FF">
<tr bgcolor="#00CCFF">
<td width="123" valign="top"><p>Day / Time</p></td>
<td width="123" valign="top"><p>10:00 – 10:55</p></td>
<td width="123" valign="top"><p>10:55 – 11:50</p></td>
<td width="123" valign="top"><p>11:50 – 12:45</p></td>
<td width="123" valign="top"><p>1:30 – 2:10</p></td>
</tr>
<tr>
<td width="123" valign="top" ><p>MON</p></td>
<td width="123" valign="top"><p>OR</p></td>
<td width="123" valign="top"><p>SE</p></td>
<td width="123" valign="top"><p>COAS</p></td>
<td width="123" valign="top"><p>DCCN</p></td>
</tr>
<tr>
<td width="123" valign="top"><p>TUE</p></td>
<td width="123" valign="top"><p>OR</p></td>
<td width="123" valign="top"><p>SE</p></td>
<td width="123" valign="top"><p>DCCN</p></td>
<td width="123" valign="top"><p>COAS</p></td>
</tr>
<tr>
<td width="123" valign="top"><p>WED</p></td>
<td width="123" valign="top"><p>OR</p></td>
<td width="123" valign="top"><p>COAS</p></td>
<td width="247" colspan="2" valign="top"><p align="center">JAVA LAB</p></td>
</tr>
<tr>
<td width="123" valign="top"><p>THU</p></td>
<td width="123" valign="top"><p>OR</p></td>
<td width="123" valign="top"><p>DCCN</p></td>
<td width="247" colspan="2" valign="top"><p align="center">IWD LAB</p></td>
</tr>
<tr>
<td width="123" valign="top"><p>FRI</p></td>
<td width="123" valign="top"><p>DCCN</p></td>
<td width="123" valign="top"><p>COAS</p></td>
<td width="123" valign="top"><p>SEMINAR</p></td>
<td width="123" valign="top"><p>LIBRARY</p></td>
</tr>
<tr>
<td width="123" valign="top"><p>SAT</p></td>
<td width="123" valign="top"><p>SE</p></td>
<td width="123" valign="top"><p>SE</p></td>
<td width="247" colspan="2" valign="top"><p align="center">JAVA LAB</p></td>
</tr>
</table>
</body>
</html>
3. Using HTML Generate Frame.
<html>
<head>
<title>HTML Target Frames</title>
</head>
<frameset cols="200, *">
<frame src="/html/menu.html" name="menu_page" />
<frame src="/html/main.html" name="main_page" />
<noframes>
<body>
Your browser does not support frames.
</body>
</noframes>
</frameset>
</html>
MENU.HTML
<html>
<body bgcolor="#4a7d49">
<a href="http://www.google.com" target="main_page">Google</a>
<br /><br />
<a href="http://www.microsoft.com" target="main_page">Microsoft</a>
<br /><br />
<a href="http://news.bbc.co.uk" target="main_page">BBC News</a>
</body>
</html>
MAIN.HTML
<html>
<body bgcolor="#b5dcb3">
<h3>This is main page and content from any link will be displayed here.</h3>
<p>So now click any link and see the result.</p>
</body>
</html>
4. Use HTML for the below given operation.
<html>
<head><title>Using Tagst</title></head>
<body>
<ol>
<li>The <strong>DOCTYPE</strong> declaration defines the document type to be HTML</li>
<li>The text between <strong><html></strong> and <strong></html></strong>
describes an HTML document</li>
<li>The text between <strong><head></strong> and <strong></head></strong>
provides information about the document</li>
<li>The text between <strong><title></strong> and <strong></title></strong>
provides a title for the document</li>
<li>The text between <strong><body></strong> and <strong></body></strong>
describes the visible page content</li>
<li>The text between <strong><p></strong> and <strong></p></strong> describes
a paragraph</li>
</ol>
</font>
</p>
</body></html>
5. Adding two number using JavaScript.
<html>
<body>
<h1>JavaScript Variables</h1>
<p id="demo"></p>
<script>
var price1 = 5;
var price2 = 6;
document.getElementById("demo").innerHTML =
</script>
</body>
</html>
6. Adding Two Strings Using JavaScript
<html>
<body>
<h1>JavaScript Variables</h1>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = x;
</script>
</body>
</html>
7. Adding two strings together using the concatenating (+) operator
<html>
<body>
<h1>JavaScript Operators</h1>
<p id="demo"></p>
<script>
</script>
</body>
</html>
8. Adding two strings together using the += operator
<html>
<body>
<h1>JavaScript Operators</h1>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = txt1;
</script>
</body>
</html>
9. Declare an object using JavaScript
Notes:
var length = 16; // Number
var lastName = "Johnson"; // String
var cars = ["Saab", "Volvo", "BMW"]; // Array
var x = {firstName:"John", lastName:"Doe"}; // Object
<html>
<body>
<p id="demo"></p>
<script>
var person = {
firstName : "John",
lastName : "Doe",
age : 50,
eyeColor : "blue"
};
document.getElementById("demo").innerHTML =
</script>
</body>
</html>
10. Declaration of function using JavaScript
<html>
<head>
<script>
function myFunction() {
</script>
</head>
<body>
<p id="demo"></p>
</body>
</html>
11. Declaration A function with an argument
<html>
<head>
<script>
function myfunction(txt) {
document.getElementById("demo").innerHTML = txt
</script>
</head>
<body>
<p>When you click on one of the buttons, a function will be called. The function will
display the argument that is passed to it.</p>
<p id="demo"></p>
</body>
</html>
12. Write a function that converts Fahrenheit to Celsius
<html>
<body>
<p id="demo"></p>
<script>
function toCelsius(f) {
document.getElementById("demo").innerHTML = toCelsius(32);
</script>
</body>
</html>
13. Show the current time and date using an onclick event using javascript.
<html>
<body>
<p id="demo"></p>
</body>
</html>
14. Using JavaScript Convert a string to upper case
<html>
<body>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = text.toUpperCase();
</script>
</body>
</html>
15. Convert string to lower case
<html>
<body>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = text.toLowerCase();
</script>
</body>
</html>
16. Concatenate two arrays using JavaScript
<html>
<body>
<p id="demo"></p>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = myChildren;
</script>
</body>
</html>
Output:
Cecilie,Lone,Emil,Tobias,Linus
17. Push new elements to the end of an array.
<html>
<body>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = fruits;
function myFunction() {
fruits.push("Kiwi")
document.getElementById("demo").innerHTML = fruits;
</script>
</body>
</html>
18.Reverse the order of the elements in an array - reverse()
<html>
<body>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = fruits;
function myFunction() {
fruits.sort();
fruits.reverse();
document.getElementById("demo").innerHTML = fruits;
</script>
</body>
</html>
19. Compare two number using JavaScript
<html>
<body>
<p id="demo"></p>
<script>
function myFunction() {
var x = 5;
</script>
</body>
</html>
Output:
True
20. Display 0 to 9 using While Loop.
<html>
<body>
<p>Click the button to loop through a block of code as long as i is less than 10.</p>
<p id="demo"></p>
<script>
function myFunction() {
var i = 0;
i++;
document.getElementById("demo").innerHTML = text;
</script>
</body>
</html>
Output:
The number is 0
The number is 1
The number is 2
The number is 3
The number is 4
The number is 5
The number is 6
The number is 7
The number is 8
The number is 9
21. Write a Switch Statement to know the present day.
<html>
<body>
<p id="demo"></p>
case 0:
day = "Sunday";
break;
case 1:
day = "Monday";
break;
case 2:
day = "Tuesday";
break;
case 3:
day = "Wednesday";
break;
case 4:
day = "Thursday";
break;
case 5:
day = "Friday";
break;
case 6:
day = "Saturday";
break;
</script></body></html>
<!DOCTYPE html>
<html>
<body>
<script>
window.alert(5 + 6);
</script>
</body>
</html>
24. Use Math.random() to return a random number between 0 and 1 Using JavaScript.
<html>
<body>
<p id="demo"></p>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = Math.random();
</script>
</body>
</html>