Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

Program 5: Program to create a Simple Form in HTML:

<!DOCTYPE html>
<html>
<body>

<h1>HTML Forms:</h1>

<div>
<form action="/action_page.php">
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="Submit">
<p>Choose your favorite Web language:</p>
  <input type="radio" id="html" name="fav_language" value="HTML">
  <label for="html">HTML</label><br>
  <input type="radio" id="css" name="fav_language" value="CSS">
  <label for="css">CSS</label><br>
  <input type="radio" id="javascript" name="fav_language" value="JavaScript">
  <label for="javascript">JavaScript</label>

<h2>The select Element</h2>

<p>The select element defines a drop-down list:</p>


<label for="cars">Choose a car:</label>
<select id="cars" name="cars">
<option value="volvo" value="selected">Volvo</option>
<option value="saab">Saab</option>
<option value="fiat">Fiat</option>
<option value="audi">Audi</option>
</select>

<input type="submit">
</div>
<textarea name="message" rows="10" cols="30">
The cat was playing in the garden.
</textarea>
<div>
<input type="checkbox" id="vehicle1" name="vehicle1" value="Bike">
<label for="vehicle1"> I have a bike</label><br>
<input type="checkbox" id="vehicle2" name="vehicle2" value="Car">
<label for="vehicle2"> I have a car</label><br>
<input type="checkbox" id="vehicle3" name="vehicle3" value="Boat">
<label for="vehicle3"> I have a boat</label>
</div>
<br>
<button type="button" onclick="alert('Hello World!')">Click Me!</button>

</form>
</body>
</html>

You might also like