Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[added]: HTML Forms sample #9

Merged
merged 2 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/HTML Forms/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "HTML - Forms",
"position": 13,
"link": {
"type": "generated-index",
"description": "HTML Forms are used to take input from the user."
}
}
50 changes: 50 additions & 0 deletions docs/HTML Forms/a-sample-html-form.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
sidebar_position: 14
keywords: [html, sample html, basic html]
---

# A Sample HTML Form

Before starting out to discuss about HTML Forms, let's take a look at the same HTML form.

```html title=sample-form.html
<!DOCTYPE html>
<html>
<head>
<title>My First HTML Document</title>
</head>
<body>
<h1>This is my first HTML Form.</h1>
<form>
<label for="username">Username</label>
<input type="text" placeholder="john123" id="username" />
<label for="password">Password</label>
<input type="password" placeholder="********" id="password" />
<button type="submit">Login</button>
</form>
</body>
</html>
```

## Explanation

The code above is a simple example of a login form.

- `<form>` is the declaration of the form in HTML.
- `<label>` give the label to the particular input box.
- `<input>` is the element that allows user to input certain values to them.
- `<button>` lets the user to submit the form once the form is filled.

The output of the following code is as follows:

---

<label for="username">Username</label>
<input type="text" placeholder="john123" id="username" />
<label for="password">Password</label>
<input type="password" placeholder="********" id="password" />
<button>Login</button>

---

More depth description about HTML forms are in the later pages.