.setValue(value, container?)
Available on: InDom, InDomArraySets the element’s value, normalised for its type (see getValue()).Parameters:
value {string | string[]} - Value(s) to assign
container {Document|Element|InDom} (optional) - Scope for checkbox and radio group lookups. When provided, only searches within this container for related elements. Defaults to document.
Returns: {InDom | InDomArray} - this for chainingThrows: TypeError - If the element has no writable value
Error- If the underlying element(s) has been removed
Examples:// single text input
$1('[name="username"]').setValue('Bob');
// multiple select
$1('[name="size"]').setValue(['m','l']);
// check only 'gps' in this container (other containers ignored)
const div = $1('.input-examples');
$1('[name="features"]', div).setValue('gps', div);
// a single value can be set with a string or a one-item array
// clear all editable fields
$a('input, textarea, select').setValue(null);Next: on »