diff options
author | Markus Wüstenberg | 2023-05-11 11:23:18 +0200 |
---|---|---|
committer | GitHub | 2023-05-11 11:23:18 +0200 |
commit | a9890f5337da4fc09c016d031b38e36d7b382f62 (patch) | |
tree | 1c8c6d8900db837aa4790841452a78ba6c742b21 | |
parent | 4f9709afcc83b617f17f8e5757d58a55be7bf2cf (diff) | |
parent | 4248e85def552b68672b8f6f4de12f0e2bf50517 (diff) | |
download | gomponents-a9890f5337da4fc09c016d031b38e36d7b382f62.tar.lz gomponents-a9890f5337da4fc09c016d031b38e36d7b382f62.tar.zst gomponents-a9890f5337da4fc09c016d031b38e36d7b382f62.zip |
Add "checked" bool attribute (#136)
Fixes #127.
-rw-r--r-- | html/attributes.go | 4 | ||||
-rw-r--r-- | html/attributes_test.go | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/html/attributes.go b/html/attributes.go index 3c69f94..b38dd95 100644 --- a/html/attributes.go +++ b/html/attributes.go @@ -16,6 +16,10 @@ func AutoPlay() g.Node { return g.Attr("autoplay") } +func Checked() g.Node { + return g.Attr("checked") +} + func Controls() g.Node { return g.Attr("controls") } diff --git a/html/attributes_test.go b/html/attributes_test.go index 5e2c179..bcb6daf 100644 --- a/html/attributes_test.go +++ b/html/attributes_test.go @@ -14,6 +14,7 @@ func TestBooleanAttributes(t *testing.T) { "async": Async, "autofocus": AutoFocus, "autoplay": AutoPlay, + "checked": Checked, "controls": Controls, "defer": Defer, "disabled": Disabled, |