Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Go to Latest
function getValuesByName
import { getValuesByName } from "https://deno.land/x/simple_utility@v2.0.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 = parseDOM("<input name='foo'>");
const result = getValuesByName(dom, "foo");

Parameters

element: Element
name: string

Returns

string[]