diff options
author | Markus Wüstenberg | 2024-06-06 12:49:01 +0200 |
---|---|---|
committer | GitHub | 2024-06-06 10:49:01 +0000 |
commit | b950ec2c42bd613fa23625ab6360f58b9ba28e07 (patch) | |
tree | 45794e05ec926db604412975641fbfbdf9b302f6 | |
parent | 81b2d6a9e39ff8859400bfa806cb3e712049615c (diff) | |
download | gomponents-b950ec2c42bd613fa23625ab6360f58b9ba28e07.tar.lz gomponents-b950ec2c42bd613fa23625ab6360f58b9ba28e07.tar.zst gomponents-b950ec2c42bd613fa23625ab6360f58b9ba28e07.zip |
Add LabelAttr and List attributes (#175)
Fixes #168 and fixes #169.
-rw-r--r-- | html/attributes.go | 8 | ||||
-rw-r--r-- | html/attributes_test.go | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/html/attributes.go b/html/attributes.go index 0bc5268..728807b 100644 --- a/html/attributes.go +++ b/html/attributes.go @@ -145,10 +145,18 @@ func Integrity(v string) g.Node { return g.Attr("integrity", v) } +func LabelAttr(v string) g.Node { + return g.Attr("label", v) +} + func Lang(v string) g.Node { return g.Attr("lang", v) } +func List(v string) g.Node { + return g.Attr("list", v) +} + func Loading(v string) g.Node { return g.Attr("loading", v) } diff --git a/html/attributes_test.go b/html/attributes_test.go index 1801428..acd17be 100644 --- a/html/attributes_test.go +++ b/html/attributes_test.go @@ -61,7 +61,9 @@ func TestSimpleAttributes(t *testing.T) { {Name: "href", Func: Href}, {Name: "id", Func: ID}, {Name: "integrity", Func: Integrity}, + {Name: "label", Func: LabelAttr}, {Name: "lang", Func: Lang}, + {Name: "list", Func: List}, {Name: "loading", Func: Loading}, {Name: "max", Func: Max}, {Name: "maxlength", Func: MaxLength}, |