HTML <form> with name Attribute

You are Here:

HTML <form> with name Attribute

The name attribute specifies a name for the form.

The name attribute is used when referencing the form with stylesheets or scripts.

Note: If there are multiple forms, the name of each form must be unique.

Tips: It is recommended to use id attribute instead of name attribute.

Example

HTML Online Editor
<!DOCTYPE html> <html> <body> <form action="/user-name.php" name="myForm"> Name: <input type="text" name="name"> </form> <p>The following button is from nowhere</p> <button type="submit" onclick="myForm.submit();">Submit</button> </body> </html>

Attribute Value

ValueExplanation
textSpecifies a name for the form.

Reminder

Hi Developers, we almost covered 99.5% of HTML Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in HTML.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author