0% found this document useful (0 votes)
4 views2 pages

WT Exp 8-1

The document is an HTML form that collects user information including name, email, mobile number, gender, and favorite color. It uses JavaScript to retrieve the values entered in the form fields and displays them in a textarea upon submission. The form includes input fields for text, email, telephone, a dropdown for gender selection, and a color picker.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

WT Exp 8-1

The document is an HTML form that collects user information including name, email, mobile number, gender, and favorite color. It uses JavaScript to retrieve the values entered in the form fields and displays them in a textarea upon submission. The form includes input fields for text, email, telephone, a dropdown for gender selection, and a color picker.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

<!

DOCTYPE html> const name =


<html> document.getElementById("name").value;

<head> const email =


document.getElementById("email").value;
<title>My Form</title>
const mobile =
</head> document.getElementById("mobile").valu
e;
<body>
const gender =
<form>
document.getElementById("gender").valu
<label for="name">Name:</label> e;
<input type="text" id="name" const color =
name="name"><br><br> document.getElementById("color").value;
<label for="email">Email:</label> const info = `Name: ${name}\nEmail:
${email}\nMobile_No:
<input type="email" id="email"
${mobile}\nGender: ${gender}\nFavorite
name="email"><br><br>
Color: ${color}`;
<label for="mobile">Mobile No:</label>
document.getElementById("display").valu
<input type="tel" id="mobile" e = info;
name="mobile"><br><br>
}
<label for="gender">Gender:</label>
</script>
<select id="gender" name="gender">
</body>
<option value="male">Male</option>
</html>
<option value="female">Female</option>
<option value="other">Other</option>
</select><br><br>
<label for="color">Favorite Color:</label>
<input type="color" id="color"
name="color"><br><br>
<input type="button" value="Submit"
onclick="displayInfo()">
</form>
<br><textarea
id="display"></textarea></br>
<script>
function displayInfo() {
Output :-

You might also like