Programming Examples
Create an HTML form for user registration:
Create an HTML form for user registration:
(a) Add fields for Name, Email, and Password.
(b) Include radio buttons for gender and a dropdown for country selection.
(c) Add submit and reset button.
Solution<!DOCTYPE html>
<html>
<head>
<title>User Registration Form</title>
</head>
<body>
<h2>User Registration</h2>
<form>
<!-- Name -->
<label>Name:</label><br>
<input type="text" name="name" required><br><br>
<!-- Email -->
<label>Email:</label><br>
<input type="email" name="email" required><br><br>
<!-- Password -->
<label>Password:</label><br>
<input type="password" name="password" required><br><br>
<!-- Gender -->
<label>Gender:</label><br>
<input type="radio" name="gender" value="male"> Male
<input type="radio" name="gender" value="female"> Female
<input type="radio" name="gender" value="other"> Other
<br><br>
<!-- Country -->
<label>Country:</label><br>
<select name="country">
<option value="">--Select Country--</option>
<option value="india">India</option>
<option value="usa">USA</option>
<option value="uk">UK</option>
<option value="australia">Australia</option>
</select>
<br><br>
<!-- Buttons -->
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>
</body>
</html>
▶ RUN Output/ Explanation: