Skip to main content
The Deno 2 Release Candidate is here
Learn more
Go to Latest
function domValueByRadioActive
import { domValueByRadioActive } from "https://deno.land/x/simple_utility@v2.2.1/mod.full.ts";

Get value of .checked in group of radio buttons.

Examples

Example 1

const dom = domDecode("<input type='radio' name='foo' value='1' checked><input type='radio' name='foo' value='2'>");
const result = domValueByRadioActive(dom, "foo");

Parameters

element: Element
name: string

Returns

string