-
Notifications
You must be signed in to change notification settings - Fork 0
/
attributes.go
46 lines (37 loc) · 1.28 KB
/
attributes.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package html
// Class adds a "class" attribute to the Element
func (element *Element) Class(value string) *Element {
return element.Attr("class", value)
}
// For adds a "for" attribute to the Element
func (element *Element) For(value string) *Element {
return element.Attr("for", value)
}
// ID adds an "id" attribute to the Element
func (element *Element) ID(value string) *Element {
return element.Attr("id", value)
}
// Label adds a "label" attribute to the Element
func (element *Element) Label(value string) *Element {
return element.Attr("label", value)
}
// List adds a "list" attribute to the Element
func (element *Element) List(value string) *Element {
return element.Attr("list", value)
}
// Name adds a "name" attribute to the Element
func (element *Element) Name(value string) *Element {
return element.Attr("name", value)
}
// Script adds a "data-script" attribute to the Element (hyperscript)
func (element *Element) Script(value string) *Element {
return element.Attr("data-script", value)
}
// Type adds a "type" attribute to the Element
func (element *Element) Type(value string) *Element {
return element.Attr("type", value)
}
// Value adds a "value" attribute to the Element
func (element *Element) Value(value string) *Element {
return element.Attr("value", value)
}