Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/simple_utility/src/deno_ext/dom.ts>getValueById

Simplify processing for Deno.
Go to Latest
function getValueById
import { getValueById } from "https://deno.land/x/simple_utility@v2.0.2/src/deno_ext/dom.ts";

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

Examples

Example 1

const dom = parseDOM("<input id='foo'>");
const result = getValueById(dom, "foo");

Parameters

element: Element
id: string

Returns

string