VOOZH about

URL: https://www.geeksforgeeks.org/html/html-name-attribute/

⇱ HTML name Attribute - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML name Attribute

Last Updated : 12 Jul, 2025

The HTML name attribute labels elements, notably form inputs, identifying them for data submission. It's crucial for form processing and is often used in JavaScript DOM manipulation. Unique within a form.

Note: This attribute has been DEPRECATED and is no longer recommended.

Supported tags:

ElementDescription
buttonRepresents a clickable button.
fieldsetGroups related form elements.
formContainer for form controls.
iframeEmbeds another HTML page.
inputAccepts user input.
mapDefines an image map.
metaProvides meta-information.
objectEmbeds external content.
outputDisplays calculation results.
paramProvides parameters for objects.
selectCreates a dropdown list.
textareaMultiline text input area.
keygenGenerates cryptographic keys.

Example of HTML name Attribute

Example 1: In this example we are displays GeeksforGeeks heading, form with username and password inputs, and submit button. Demonstrates the use of the button's name attribute.

Output:

👁 buttonAttribute
HTML name Attribute Example Output

Example 2: In this example the HTML select element with name attribute defines a dropdown list. Each option has a value. Important for form submission and JavaScript DOM manipulation. 

Output:

👁 NameAttribute
HTML name Attribute Example Output

Supported Browsers: The browsers supported by HTML | name Attribute are listed below: 

Comment
Article Tags: