HTML Forms



HTML forms are very required.if you want to get some data from your visitor.everyone would like to collect some information such as email address and name and more.

HTML <form>Tag Syntax

<form>
    <p>
    First name: <input type="text" name="first-name">
    <button type="submit" value="Submit">Submit</button>
    <button type="reset" value="Reset">Reset</button>
    </p>
    </form>

HTML Form Attributes

S.No Attribute Description
1 action it is used to Backend script ready to process your passed data.
2 method it is used to most frequently used are GET and POST methods.
3 enctype it is used to the web browser encodes the data before it sends it to the server.
4 target it is used to takes values like _blank, _self, _parent etc.

Example

<!DOCTYPE html>
    <html lang="en">
    <head>
        <title>Example of HTML form tag</title>
    </head>
    <body>
    <form>
    <p>
    First name: <input type="text" name="first-name">
    <button type="submit" value="Submit">Submit</button>
    <button type="reset" value="Reset">Reset</button>
    </p>
    </form>
    </body>
    </html> 
    


Click on the "Run This Code" button to see how it works.





HTML

Welcome HTML Getting Started HTML Elements HTML Attributes HTML Headings HTML Paragraphs HTML Links HTML Styles HTML Text Formatting HTML Tables HTML Images HTML Forms HTML Lists HTML Iframes HTML Comments HTML CSS HTML Colors HTML Classes HTML Id HTML javascript HTML Filepaths

HTML Advanced

HTML Doctypes HTML Validation HTML Validation HTML URL HTML URL Encode HTML URL Entities HTML Layout HTML Head HTML Meta HTML Scripts HTML Tags

HTML Media

HTML Media HTML Audio HTML Video HTML Plug-ins HTML Youtube

HTML Graphics

HTML Canvas HTML SVG