Search.../

value

Sets or gets an element's value.

Description

The value property's type depends on the element implementing it.

Notes:

  • Changing an element's value in code does not trigger an onChange event.
  • If an element is connected to a dataset, setting the element's value in code does not set the value of the connected field in the dataset. That means if you use the dataset to perform a submit, the value changed in code is not reflected in the submitted item.
  • To submit the new value using a dataset, set the field's value using the setFieldValue() function before performing the submit.

Type:

*Read & Write
Mixed in from:$w.FormElement

Was this helpful?

Get an element's value

Code Example

Copy Code
1let myValue = $w("#myElement").value; // "42"
Set an element's value

Code Example

Copy Code
1$w("#myElement").value = "42";