be-valued (๐)
June 18, 2026 ยท View on GitHub
Reflect the value of the input to the value attribute on input event.
<form be-valued>
<input>
</form>
Useful for styling, persistence of innerHTML. Works with any element whose string "value" can be determined by doing oElement.value, and which emits event "input" when the value changes. Both "value" and "input" are configurable.
The enhancement continues to honor reset input elements:
<input type="reset" value="Reset the form" />
by intercepting the reset event and implementing that functionality within the enhancement.
Viewing Locally
Any web server that serves static files with server-side includes will do but...
- Install git
- Fork/clone this repo
- Install node.js
- Open command window to folder where you cloned this repo
-
git submodule add https://github.com/bahrus/types.git types
-
git submodule update --init --recursive
-
npm install
-
npm run serve
- Open http://localhost:8000/demo/ in a modern browser
Importing in ES Modules:
import 'be-valued/be-valued.js';
Using from CDN:
<script type=module crossorigin=anonymous>
import 'https://esm.run/be-valued';
</script>
