Skip to content
Related Articles
Open in App
Not now

Related Articles

HTML | <form> name Attribute

Improve Article
Save Article
  • Difficulty Level : Medium
  • Last Updated : 22 Jul, 2022
Improve Article
Save Article

The HTML <form> name Attribute is used to specify the name of a form Element. It is used to reference the form-data after submitting the form or to reference the element in a JavaScript. 

Syntax: 

<form name="name"> 

Attribute Values: It contains a single value name which describes the name of the <form> element. 

Example: 

html




<!DOCTYPE html>
<html>
 
<body style="text-align:center;">
    <h1 style="color:green;">
    GeeksForGeeks
</h1>
 
    <h2>HTML Form name Attribute.</h2>
    <form id="users" action="#" name="Geeks">
        First name:
 
        <input type="text" name="fname" value="Manas">
        <br> Last name:
 
        <input type="text" name="lname" value="Chhabra">
        <br>
 
        <input type="submit" value="Submit">
    </form>
</body>
 
</html>


Output:

  

Supported Browsers:

  • Google Chrome
  • Firefox
  • Edge 12 and above
  • Internet Explorer 
  • Opera
  • Apple Safari
My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!