HTML Attribute Reference
This complete HTML attribute list organizes attributes by their purpose, making it easier to find attributes used for links, forms, media, tables, scripts, accessibility, document metadata, and other HTML features. Use the search box to find an attribute by name or description, or switch to the alphabetical view when you already know the attribute you are looking for.
Each attribute links to its complete reference page with syntax, values, applicable elements, examples, browser support, and other useful information. Obsolete attributes are included in a separate section for understanding and maintaining older HTML, but they should not be used when creating new webpages.
Search HTML Attributes
Enter an attribute name or a word describing what the attribute does. The list will automatically display matching attributes.
No HTML attributes found.
Global Attributes
Global attributes can be used with HTML elements regardless of the element's specific purpose. See the Global Attribute List for the complete reference.
accesskeyProvides a keyboard shortcut for activating or focusing an element.autocapitalizeControls automatic capitalization when text is entered.autocorrectControls automatic correction of entered text.autofocusRequests that an element receive focus automatically.classAssigns one or more class names to an element.contenteditableIndicates whether the element's content can be edited by the user.data-*Stores custom data associated with an element.dirSpecifies the direction of the element's text.draggableIndicates whether an element can be dragged.enterkeyhintProvides a hint for the action shown on a virtual keyboard's Enter key.hiddenIndicates that an element is not currently relevant.idProvides a unique identifier for an element.inertMakes an element and its descendants non-interactive.inputmodeHints which type of input interface should be displayed.langSpecifies the language of an element's content.nonceProvides a cryptographic nonce used with Content Security Policy.popoverDesignates an element as popover content.spellcheckIndicates whether spelling and grammar checking should be enabled.styleApplies inline CSS declarations to an element.tabindexControls whether and how an element participates in keyboard focus navigation.titleProvides advisory information about an element.translateIndicates whether an element's translatable content should be translated.writingsuggestionsControls whether browser writing suggestions are enabled.Links & Resources
downloadIndicates that a linked resource should be downloaded.hrefSpecifies the URL of a linked resource.hreflangSpecifies the language of a linked resource.pingSpecifies URLs that are notified when a hyperlink is followed.referrerpolicyControls referrer information sent when fetching a resource.relDefines the relationship between the current document and a linked resource.targetSpecifies where linked content or a form response should be displayed.Forms & User Input
acceptSpecifies acceptable file types for a file upload control.accept-charsetSpecifies the character encoding used for form submission.actionSpecifies the URL that processes submitted form data.alphaAllows a color input to include an alpha transparency component.autocompleteControls or provides hints for automatic form completion.checkedSpecifies that a checkbox or radio control is initially selected.colorspaceSpecifies the color space used by a color input.colsSpecifies the visible width of a textarea in characters.dirnameSubmits the directionality of a form control's text.disabledPrevents a form control from being used.enctypeSpecifies how submitted form data is encoded.forAssociates a label or output with another element.formAssociates a form-associated element with a form.formactionOverrides the form's submission URL for a submit control.formenctypeOverrides the form's submission encoding for a submit control.formmethodOverrides the form's submission method for a submit control.formnovalidateDisables form validation for a particular submit control.formtargetOverrides where the form response is displayed.highSpecifies the lower boundary of a meter's high range.listAssociates an input with a datalist of suggested values.lowSpecifies the upper boundary of a meter's low range.maxSpecifies the maximum permitted value.maxlengthSpecifies the maximum number of characters allowed.methodSpecifies the HTTP method used to submit a form.minSpecifies the minimum permitted value.minlengthSpecifies the minimum number of characters required.multipleAllows more than one value or file to be selected.nameProvides a name used when identifying or submitting a control.novalidateDisables validation when a form is submitted.optimumSpecifies the optimal value for a meter.patternSpecifies a pattern that an input value must match.placeholderProvides a short hint describing an expected input value.readonlyPrevents the user from changing a control's value.requiredRequires a value before a form can be submitted.rowsSpecifies the visible number of text lines in a textarea.selectedSpecifies that an option is initially selected.sizeSpecifies the displayed size of certain form controls.stepSpecifies the permitted interval between numeric or date values.valueSpecifies a value associated with an element.wrapControls how textarea content is wrapped when submitted.Images & Media
altProvides alternative text for an image.autoplayRequests that audio or video begin playing automatically.controlsDisplays browser-provided media playback controls.coordsSpecifies coordinates for an image-map area.crossoriginControls cross-origin requests for a resource.decodingProvides a hint for how an image should be decoded.heightSpecifies an element's intrinsic or displayed height where supported.ismapIdentifies an image as a server-side image map.kindSpecifies the type of text track.loadingControls whether loading may be deferred.loopCauses media to restart after reaching the end.mutedSpecifies that media audio is initially muted.playsinlineIndicates that video should play within its page area.posterSpecifies an image displayed before a video begins playing.preloadProvides a hint about how media should be loaded.shapeSpecifies the shape of an image-map area.sizesProvides layout-size information for responsive images or linked resources.srcSpecifies the URL of an embedded resource.srclangSpecifies the language of a text track.srcsetProvides multiple image candidates for different display conditions.usemapAssociates an image with a client-side image map.widthSpecifies an element's intrinsic or displayed width where supported.Tables
abbrProvides an alternative abbreviated label for a table header cell.colspanSpecifies how many columns a table cell spans.headersAssociates a table cell with one or more header cells.rowspanSpecifies how many rows a table cell spans.scopeSpecifies which table cells a header applies to.spanSpecifies how many columns a col or colgroup represents.Scripts & External Resources
asSpecifies the type of content being fetched by certain link relationships.asyncAllows a script to execute as soon as it is available.blockingControls whether an external resource can block rendering.deferDelays script execution until document parsing has completed.fetchpriorityProvides a hint about the relative priority of a resource fetch.imagesizesProvides image-size information when preloading responsive images.imagesrcsetProvides responsive image candidates when preloading an image.integrityProvides integrity metadata for verifying a fetched resource.mediaSpecifies the media or conditions for which a resource applies.nomodulePrevents a script from running in browsers that support JavaScript modules.Metadata & Document Information
charsetDeclares the character encoding of an HTML document.contentProvides the value of metadata defined by a meta element.http-equivDefines a pragma directive for document metadata.Interactive Content
allowSpecifies a Permissions Policy for an embedded iframe.allowfullscreenAllows an iframe's content to use fullscreen mode.closedbyControls which user actions may close a dialog.commandSpecifies the command performed by a button.commandforAssociates a button command with another element.openIndicates that a details or dialog element is open.popovertargetAssociates a button with a popover element.popovertargetactionSpecifies how a button affects its target popover.sandboxApplies security restrictions to embedded iframe content.srcdocProvides inline HTML content for an iframe.Web Components
exportpartsExports selected CSS shadow parts from a shadow tree.partAssigns names used to style parts of a shadow tree.shadowrootclonableControls whether a declarative shadow root can be cloned.shadowrootcustomelementregistryControls the custom element registry used by a declarative shadow root.shadowrootdelegatesfocusEnables focus delegation for a declarative shadow root.shadowrootmodeSpecifies the mode of a declarative shadow root.shadowrootserializableControls whether a declarative shadow root is serializable.shadowrootslotassignmentSpecifies the slot-assignment mode of a declarative shadow root.slotAssigns an element to a named slot in a shadow tree.Other HTML Attributes
captureProvides a hint about the preferred capture source for file input.citeProvides a URL identifying the source of a quotation or edit.dataSpecifies the resource used by an object element.datetimeProvides a machine-readable date or time value.defaultIdentifies the default text track.elementtimingIdentifies an element for Element Timing performance measurements.labelProvides a user-visible label for certain elements.reversedDisplays an ordered list in descending order.startSpecifies the starting value of an ordered list.typeSpecifies the type or purpose of an element or resource where supported.virtualkeyboardpolicyControls virtual keyboard behavior for editable content.Obsolete Attributes
These attributes were used in older versions of HTML but are obsolete and should not be used when creating new webpages. They are included to help identify and maintain older HTML.
alignObsolete — historically controlled alignment or positioning.alinkObsolete — historically specified the color of active links.allowtransparencyObsolete — historically controlled transparency for embedded frame content.archiveObsolete — historically identified archives containing resources for embedded content.axisObsolete — historically categorized table header cells.backgroundObsolete — historically specified a background image.bgcolorObsolete — historically specified a background color.borderObsolete — historically controlled borders on certain elements.bordercolorObsolete — historically specified a border color.bottommarginObsolete — historically controlled the document's bottom margin.cellpaddingObsolete — historically controlled spacing inside table cells.cellspacingObsolete — historically controlled spacing between table cells.charObsolete — historically aligned table content around a character.charoffObsolete — historically specified an offset for character-based table alignment.classidObsolete — historically identified an implementation for embedded content.clearObsolete — historically controlled text flow around floated content.codeObsolete — historically identified an applet class file.codebaseObsolete — historically specified a base URL for embedded code.codetypeObsolete — historically specified the content type of embedded code.colorObsolete — historically specified text or rule colors.compactObsolete — historically requested a compact presentation.contextmenuObsolete — historically associated an element with a context menu.datafldObsolete — historically identified a data-bound field.dataformatasObsolete — historically controlled the format of data-bound content.datapagesizeObsolete — historically specified a page size for data-bound content.datasrcObsolete — historically identified a data source.declareObsolete — historically declared an object without immediately instantiating it.dropzoneObsolete — historically described acceptable drag-and-drop operations.eventObsolete — historically identified an event associated with a script.faceObsolete — historically specified a font family.frameObsolete — historically controlled which sides of a table border were displayed.frameborderObsolete — historically controlled borders around frames.framespacingObsolete — historically controlled spacing between frames.hspaceObsolete — historically added horizontal space around an element.languageObsolete — historically identified the scripting language.leftmarginObsolete — historically controlled the document's left margin.linkObsolete — historically specified the color of unvisited links.longdescObsolete — historically provided a URL for a long description.lowsrcObsolete — historically specified a low-resolution image source.manifestObsolete — historically identified an application cache manifest.marginheightObsolete — historically controlled vertical frame margins.marginwidthObsolete — historically controlled horizontal frame margins.methodsObsolete — historically provided information about supported HTTP methods.nohrefObsolete — historically indicated that an image-map area had no hyperlink.noresizeObsolete — historically prevented a frame from being resized.noshadeObsolete — historically removed the shaded appearance of a horizontal rule.nowrapObsolete — historically prevented text from wrapping.onshowObsolete — historically provided an event handler for showing a context menu.profileObsolete — historically specified metadata profile URLs.revObsolete — historically described a reverse link relationship.rightmarginObsolete — historically controlled the document's right margin.rulesObsolete — historically controlled internal borders in a table.schemeObsolete — historically provided a scheme for interpreting metadata.scrollingObsolete — historically controlled scrollbars in frame content.standbyObsolete — historically provided a message while an object loaded.summaryObsolete — historically provided a description of a table's structure or purpose.textObsolete — historically specified the document's text color.topmarginObsolete — historically controlled the document's top margin.typemustmatchObsolete — historically required an object's declared and actual media types to match.urnObsolete — historically identified a persistent resource name.valignObsolete — historically controlled vertical alignment.versionObsolete — historically identified an HTML version.vlinkObsolete — historically specified the color of visited links.vspaceObsolete — historically added vertical space around an element.HTML Attributes A–Z
All HTML attributes are shown alphabetically below. Obsolete attributes remain clearly identified.
