HTML Attribute Extractor: Choose attributes and review results
HTML Attribute Extractor parses your markup with DOMParser, then lists selected attribute values from element descendants inside the parsed <body>. The table shows Tag, Attribute, Value, and Element.
How to extract HTML attributes
- Paste HTML: Enter markup in the input area. You can also select a
.html,.htm, or.txtfile with Upload, or drop a file on the input area. - Choose attributes: Select preset checkboxes for
src,href,class,id,alt,title,name,value,rel, ortarget. The first four are selected initially. Type additional comma-separated names in Custom attributes (comma-separated), such asdata-role, aria-label. - Filter tags when needed: Enter comma-separated names in Filter by tag (comma-separated), such as
img,a. - Review the results: The table refreshes automatically when you edit the HTML, change a checkbox, or change either text field. There is no separate Extract or Run button. Reset extraction options restores the four default attributes and clears both text filters.
- Export nonempty results: Select Copy for tab-separated text, including the headers
Tag,Attribute,Value, andElement. Select CSV to downloadhtml-attributes.csv.
Understand the result table and empty states
Each row represents a selected attribute that exists on a matching element. If an element does not have a selected attribute, the tool creates no row for it. Element is an ordinal such as #1; it is not a CSS selector, source line, or unique DOM identifier. When you use a tag filter, the ordinal is counted among matching elements only.
- Blank input shows Paste HTML to see extracted attributes.
- Nonblank input with no matching rows shows No matching attributes found.
- Copy and CSV produce no export when there are no results.
Scope and limitations
The script scans elements returned by doc.body.querySelectorAll("*"). It does not directly scan the <html>, <head>, or <body> elements themselves. Parsing uses an inert DOM document, so scripts in pasted markup do not execute through this parsing step.
The tool extracts attribute values; it does not validate accessibility, links, destinations, or whether an attribute is correct. It also does not extract bare URLs from plain text. Use the URL Extractor for plain-text URL extraction. The local implementation does not define a maximum input size, upload encoding policy, parse-error message, malformed-markup warning, or browser compatibility guarantee.
Frequently Asked Questions (FAQs)
Which attributes can I extract?
Any attribute. Select a preset such as src, href, class, id, alt, title, name, value, rel, or target, or enter any name, including data-* attributes, in the custom field.
How is this different from a regex-based extractor?
The tool first parses the markup into a DOM tree with the browser's DOMParser, then reads attributes from elements. This handles nested markup, quoted attributes, and self-closing syntax as handled by the browser parser.
Can I limit results to specific tags?
Yes. Enter a comma-separated list of tag names, such as img,a, to extract attributes only from those matching elements inside the parsed body.
Is my data safe when I paste it here?
The extractor code parses pasted HTML locally with DOMParser in an inert document and contains no request that sends the pasted HTML. This scoped statement does not describe every resource or analytics script loaded by the page.