About Lesson
Defination:
- HTML forms are a fundamental part of web development and are used to collect user input on a web page.
- Forms allow users to enter data, such as text, numbers, passwords, and more, which can be sent to a web server for processing.
- Forms are created using the <form> element in HTML.
Structure:
Here’s a basic structure of an HTML form:
<form action=”/submit_form” method=”POST”>
<!– form elements go here –>
</form>
- The action attribute specifies the URL where the form data will be sent for processing.
- The method attribute specifies how to send the form data. It can be either GET or POST. GET appends the form data to the URL, while POST sends the data in the body of the HTTP request, which is more secure for sensitive information like passwords.