Close Menu
    Facebook X (Twitter) Instagram
    Oixiesoft
    • Home
    • Services
      • WordPress Malware Removal
      • Fix WordPress Errors
      • WordPress Website Development
    • Articles
    • Contact
    Oixiesoft
    Home»Tutorial»html»HTML Form Attributes
    html

    HTML Form Attributes

    Editorial StaffBy Editorial StaffUpdated:May 9, 2022No Comments2 Mins Read
    Share
    Facebook Twitter LinkedIn Pinterest Email

    HTML Form Attributes

    There are different types of attributes for the HTML

    element that is used to gather data. This chapter describes all these attributes one by one.

    The Method Attribute

    The method attribute specifies the HTTP method to be used when uploading the form data. It can take different values but most frequently used are GET (method=”get”) and POST ( method=”post”).

    Example of GET method

    <form action="test.php"  method="get">
      <label for="fname">Name:</label><br>
      <input type="text" id="name" name="name" value="Camila"><br>
      <label for="">Email:</label><br>
      <input type="text" id="email" name="email" value="[email protected]"><br><br>
      <input type="submit" value="Submit">
    </form> 
    

    Output




    Example of POST method

    <form action="test.php"  method="post">
      <label for="fname">Name:</label><br>
      <input type="text" id="name" name="name" value="Camila"><br>
      <label for="">Email:</label><br>
      <input type="text" id="email" name="email" value="[email protected]"><br><br>
      <input type="submit" value="Submit">
    </form> 
    

    Output





    The Action Attribute

    The action attribute defines any script URL which will receive uploaded form data.

    Example of Action Attribute

    <form action="test.php">
      <label for="fname">Name:</label><br>
      <input type="text" id="name" name="name" value="Camila"><br>
      <label for="">Email:</label><br>
      <input type="text" id="email" name="email" value="[email protected]"><br><br>
      <input type="submit" value="Submit">
    </form> 
    

    The Target Attribute

    The target attribute specifies the target page where the response of the script will be displayed.
    The target attribute takes multiple values as follows:

    • _blank,
    • _self,
    • _parent
    • _top etc.

    Example of target attribute

    <form action="test.php"  target="_blank">
      <label for="fname">Name:</label><br>
      <input type="text" id="name" name="name" value="Camila"><br>
      <label for="">Email:</label><br>
      <input type="text" id="email" name="email" value="[email protected]"><br><br>
      <input type="submit" value="Submit">
    </form> 
    
    Share. Facebook Twitter Pinterest LinkedIn WhatsApp Reddit Tumblr Email
    Editorial Staff

    Related Posts

    CodeIgniter vs Laravel: A Detailed Side-by-Side Comparison

    Python Arrays

    Python Lambda

    • HTML Introduction
    • HTML Editors
    • HTML Tags
    • HTML Attributes
    • HTML Headings
    • HTML Paragraphs
    • HTML Comments
    • HTML Styles
    • HTML Text Formatting
    • HTML Colors
    • HTML links
    • HTML Images
    • HTML Styles – CSS
    • HTML Tables
    • HTML Lists
    • HTML Forms
    Services
    • Web Development
    • Mobile Application Development
    • WordPress Malware Removal Service
    • Website Design
    • WordPress Development
    • Magento Development
    • Shopify Development
    • SEO Services
    Blog
    • How to Fix the Error Establishing a Database Connection
    • Ping List WordPress
    • How To Fix Japanese Keyword Hack
    • How to remove Malware from WordPress
    Hire Developers
    • Hire WordPress Developer
    • Hire Shopify Developer
    Contact Info
    • Oixiesoft Technologies
      A-40, Block A, I thum Tower, Sector 62, Noida
    • [email protected]
    • Privacy Policy
    • About Us
    • Contact Us
    © 2025 OixieSoft Technologies

    Type above and press Enter to search. Press Esc to cancel.