diff options
author | Markus Wüstenberg | 2020-12-10 14:20:33 +0100 |
---|---|---|
committer | GitHub | 2020-12-10 14:20:33 +0100 |
commit | febffb600db7fbfd81827ded1b8fa3774bf42107 (patch) | |
tree | 853ef8b506ec986f3e4bfe11dc93486af4131006 /html/attributes.go | |
parent | 100ae9e8308f380eeb3c6a5ea7a7e3277483aa43 (diff) | |
download | gomponents-febffb600db7fbfd81827ded1b8fa3774bf42107.tar.lz gomponents-febffb600db7fbfd81827ded1b8fa3774bf42107.tar.zst gomponents-febffb600db7fbfd81827ded1b8fa3774bf42107.zip |
Simplify available elements (#55)
`a`, `form`, `img`, `input`, `label`, `option`, `progress`, `select`, and `textarea` are now just regular elements (without helper parameters), because: - Sometimes the use case doesn't fit (`a` as anchor without href, for example) - There's no reason these are special among the others, so streamlining them makes sense Also added new attributes `action`, `alt`, `for`, `method` that I had somehow missed.
Diffstat (limited to 'html/attributes.go')
-rw-r--r-- | html/attributes.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/html/attributes.go b/html/attributes.go index 3db8584..e67bc1f 100644 --- a/html/attributes.go +++ b/html/attributes.go @@ -48,6 +48,14 @@ func Accept(v string) g.Node { return g.Attr("accept", v) } +func Action(v string) g.Node { + return g.Attr("action", v) +} + +func Alt(v string) g.Node { + return g.Attr("alt", v) +} + func AutoComplete(v string) g.Node { return g.Attr("autocomplete", v) } @@ -68,6 +76,10 @@ func Content(v string) g.Node { return g.Attr("content", v) } +func For(v string) g.Node { + return g.Attr("for", v) +} + func FormAttr(v string) g.Node { return g.Attr("form", v) } @@ -96,6 +108,10 @@ func MaxLength(v string) g.Node { return g.Attr("maxlength", v) } +func Method(v string) g.Node { + return g.Attr("method", v) +} + func Min(v string) g.Node { return g.Attr("min", v) } |