HTML name attribute HTML tag Example with the name attribute element: name="obj1"> Try it » Browser support All major browsers support the name attribute. Definition and Usage The name attribute specifies The name of the element. The name attribute is used to reference the element in JavaScript (the alternative is to reference it by using the id attribute). Differences between HTML 4.01 and HTML5 none. Syntax Attribute values Value Description name The name of the element. HTML tag