Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/html_parser/src/utils/traversal.ts>getAttributeValue

Port of fb55/htmlparser2 for Deno
Latest
function getAttributeValue
import { getAttributeValue } from "https://deno.land/x/html_parser@v0.1.3/src/utils/traversal.ts";

Gets an attribute from an element.

Parameters

elem: Element

Element to check.

name: string

Attribute name to retrieve.

Returns

string | undefined

The element's attribute value, or undefined.