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

x/html_parser/src/mod.ts>DomUtils.getAttributeValue

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

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.