Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( TagOpen = []byte("<optgroup") TagClose = []byte("</optgroup>") AttrLabel = []byte(" label=\"") AttrDisabled = []byte(" disabled") )
Byte constants for HTML rendering.
Functions ¶
func Labelled ¶ added in v0.3.0
Labelled Creates a labelled optgroup from option elements, enforcing correct nesting at compile time. Example: optgroup.Labelled("Colours", option.Option("red", "Red"), option.Option("blue", "Blue")) Renders: <optgroup label="Colours"><option value="red">Red</option><option value="blue">Blue</option></optgroup>
func New ¶
New Creates a new optgroup element with child option elements. Example: optgroup.New(option.Option("red", "Red"), option.Option("blue", "Blue")).Label("Colours") Renders: <optgroup label="Colours"><option value="red">Red</option><option value="blue">Blue</option></optgroup>
func Options ¶ added in v0.3.0
Options Creates an optgroup from option elements, enforcing correct nesting at compile time. Example: optgroup.Options(option.Option("red", "Red"), option.Option("blue", "Blue")).Label("Colours") Renders: <optgroup label="Colours"><option value="red">Red</option><option value="blue">Blue</option></optgroup>