Skip to content

Instantly share code, notes, and snippets.

@daanyaalkapadia
Created September 30, 2020 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daanyaalkapadia/54092b733d94ada204bbd1adb0d981e6 to your computer and use it in GitHub Desktop.
Save daanyaalkapadia/54092b733d94ada204bbd1adb0d981e6 to your computer and use it in GitHub Desktop.
A basic demo of html form.
<form action="">
<!-- text input -->
<div>
<label for="name">Name:</label><br>
<input type="text" name="name" id="name" value="Daanyaal Kapadia">
</div>
<!-- email input -->
<div>
<label for="email">Email:</label><br>
<input type="email" name="email" id="email" placeholder="example@example.com">
</div>
<!-- number input -->
<div>
<label for="age">Age:</label><br>
<input type="number" name="age" id="age">
</div>
<!-- select input -->
<div>
<label for="designation">Designation:</label><br>
<select name="designation" id="designation">
<option value="student">Student</option>
<option value="employeed" selected>Employeed</option>
<option value="usiness">Business</option>
</select>
</div>
<!-- date input -->
<div>
<label for="dob">Date of Birth:</label><br>
<input type="date" name="dob" id="dob">
</div>
<!-- radio input -->
<div>
<label for="course">Course:</label><br>
<input type="radio" value="be" name="course" id="course" checked>B.E.
<input type="radio" value="btech" name="course" id="course">B.Tech.
</div>
<!-- checkbox input -->
<div>
<label for="subject">Subject:</label><br>
<input type="checkbox" value="ai" name="subject" id="subject" checked>AI
<input type="checkbox" value="dsa" name="subject" id="subject">DSA
</div>
<!-- text area input -->
<div>
<label for="message">Message:</label><br>
<textarea name="message" id="message" cols="30" rows="10"></textarea>
</div>
<input type="submit" value="Submit">
<!-- <button type="submit">Submit</button> -->
<input type="reset" value="Reset">
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment