HTML EXAMPLE · WORKING REFERENCE

Create an HTML Form

Labelled text aur email inputs ke saath accessible basic form structure banao.

Working code

<form action="#" method="post">
  <label for="name">Name</label>
  <input id="name" name="name" type="text" required>

  <label for="email">Email</label>
  <input id="email" name="email" type="email" required>

  <button type="submit">Submit</button>
</form>
Run Code ▶

Preview


How it works

<form> related controls group karta hai.

label for matching input id se accessible association banata hai. required browser validation enable karta hai.

Try Yourself

<form>
  <label for="topic">Topic</label>
  <input id="topic" name="topic" type="text" required>

  <button type="submit">Save</button>
</form>

Learn this concept

Read related HTML Tutorial →