Practical 6
Practical 6
<!DOCTYPE html>
<html>
<head>
<title>Document</title>
</head>
<body>
<form><br>
Enter Username :<br>
<input type="text" name="username" id="username"><br><br>
Enter Password :<br>
<input type="password" name="password" id="password"><br>
<input type="button" value="Button" onclick="msg()"><br>
</form>
<script>
function msg()
{
var a=document.getElementById("username").value;
var b=document.getElementById("password").value;
alert("Username :"+a+" Password :"+b);
}
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>College Registration</title>
<h1>Fill Below Registration Form</h1>
<script>
function msg()
{
alert("Registered Successfully !!!");
}
</script>
</head>
<body>
<form>
Enter Name :<br>
( First Name, Middle Name, LastName ) <br><br>
<input type="text" size="30" value=""><br><br>
Enter Mobile Number :<br>
<input type="text" size="10" value="" maxlength="10">
<br> <br>
Enter Address :<br>
<textarea cols="40" rows="10" name="address">
</textarea>
<br> <br>
Select Department : <br><br>
<input type="checkbox" name="option1" value="Computer Technology">Computer
Technology<br>
<select name="years">
<option value="Select Year">Select Year</option>
<option value="First Year">First Year</option>
<option value="Second Year">Second Year</option>
<option value="Third Year">Third Year</option>
</select> <br>
<input type="checkbox" name="option1" value="Information Technology">Information
Technology<br>
<select name="years">
<option value="Select Year">Select Year</option>
<option value="First Year">First Year</option>
<option value="Second Year">Second Year</option>
<option value="Third Year">Third Year</option>
</select> <br>
<input type="checkbox" name="option1" value="Electrical">Electrical<br>
<select name="years">
<option value="Select Year">Select Year</option>
<option value="First Year">First Year</option>
<option value="Second Year">Second Year</option>
<option value="Third Year">Third Year</option>
</select> <br>
<input type="checkbox" name="option1" value="Civil">Civil<br>
<select name="years">
<option value="Select Year">Select Year</option>
<option value="First Year">First Year</option>
<option value="Second Year">Second Year</option>
<option value="Third Year">Third Year</option><br>
</select> <br>
<input type="checkbox" name="option1" value="Mechanical">Mechanical<br>
<select name="years">
<option value="Select Year">Select Year</option>
<option value="First Year">First Year</option>
<option value="Second Year">Second Year</option>
<option value="Third Year">Third Year</option><br>
</select> <br>
<input type="checkbox" name="option1" value="Electronics">Electronics<br><br>
<select name="years">
<option value="Select Year">Select Year</option>
<option value="First Year">First Year</option>
<option value="Second Year">Second Year</option>
<option value="Third Year">Third Year</option>
</select> <br> <br>
Select Your Gender :<br>
<input type="radio" name="gender" id="radio-female" value="Female">Female
<input type="radio" name="gender" id="radio-male" value="Male">Male
<br> <br>
<input type="button" value="Register" onclick="msg()">
<input type="reset" value="Reset">
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title> FORM </title>
<H1>CHANGE BACKGROUND DYNAMICAllY</H1>
</head>
<body id="mybody">
<select name="mylist" id="mylist">
<option value="Red" name="red" id="red">Red</option>
<option value="Green" name="green" id="green">Green</option>
<option value="Blue" name="blue" id="blue">Blue</option>
<option value="Yellow" name="yellow" id="yellow">Yellow</option>
</select>
<script>
var a=document.getElementById("mylist");
a.addEventListener("change",f1,true);
function f1()
{
var v=document.getElementById("mylist").value;
document.getElementById("mybody").style.backgroundColor=v;
}
</script>
</body>
</html>