diff options
author | Joey <jyapayne@gmail.com> | 2021-05-17 00:04:39 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-17 08:04:39 +0200 |
commit | e904c6d87ccbb453f6f1d649b2c715bd3cebc815 (patch) | |
tree | 5b2b8628677fcb57f9bbf76a29f352c909dd2bd5 | |
parent | 2096490b5974cfb11d0f5d37ff6d3a963ef43713 (diff) | |
download | Nim-e904c6d87ccbb453f6f1d649b2c715bd3cebc815.tar.gz |
Add `checked` to dom (#18033)
This allows the ability to set a checkbox as checked programmatically. It's different from `setAttribute` because once an input has been clicked on by the user, `setAttribute` no longer works programmatically.
-rw-r--r-- | lib/js/dom.nim | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/js/dom.nim b/lib/js/dom.nim index 303cc178f..16fc96b68 100644 --- a/lib/js/dom.nim +++ b/lib/js/dom.nim @@ -1379,6 +1379,9 @@ proc `class=`*(n: Node; v: cstring) {.importcpp: "#.className = #", nodecl.} proc value*(n: Node): cstring {.importcpp: "#.value", nodecl.} proc `value=`*(n: Node; v: cstring) {.importcpp: "#.value = #", nodecl.} +proc checked*(n: Node): bool {.importcpp: "#.checked", nodecl.} +proc `checked=`*(n: Node; v: bool) {.importcpp: "#.checked = #", nodecl.} + proc `disabled=`*(n: Node; v: bool) {.importcpp: "#.disabled = #", nodecl.} when defined(nodejs): |