datalist

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TagOpen  = []byte("<datalist")
	TagClose = []byte("</datalist>")
)

Byte constants for HTML rendering.

Functions

func New

func New(nodes ...node.Node) *element

New Creates a new datalist element with child nodes (typically <option> elements). Example: datalist.New(option.New().Value("Chocolate"), option.New().Value("Vanilla")) Renders: <datalist><option value="Chocolate"><option value="Vanilla"></datalist>

func Options added in v0.3.0

func Options(options ...*option.Element) *element

Options Creates a datalist from option elements, enforcing correct nesting at compile time. Example: datalist.Options(option.Option("chocolate", "Chocolate"), option.Option("vanilla", "Vanilla")) Renders: <datalist><option value="chocolate">Chocolate</option><option value="vanilla">Vanilla</option></datalist>

Types

type Element

type Element = element

Element is an exported alias for the private element type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL