Skip to main content
The Deno 2 Release Candidate is here
Learn more
Latest
function domValuesByName
import { domValuesByName } from "https://deno.land/x/simple_utility@v2.3.2/src/deno_ext/dom.ts";

Get value by name search. .value for <input>, .textContent for <textarea> and .value of .selected for <select> <dataset>.

Examples

Example 1

const dom = domDecode("<input name='foo'>");
const result = domValuesByName(dom, "foo");

Parameters

element: Element
name: string

Returns

string[]