HTML Attribute Reference
This HTML attribute list organizes current and global 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. For attributes no longer used in modern HTML, visit the HTML Obsolete Attribute List.
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 HTML Global Attributes 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.HTML Attributes A–Z
Current and global HTML attributes are shown alphabetically below.
