Documentation
¶
Overview ¶
Package textarea provides constructors and methods for the HTML <textarea> element.
The <textarea> HTML element represents a multi-line plain-text editing control, useful when you want to allow users to enter a sizeable amount of free-form text, for example a comment on a review or feedback form.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( TagOpen = []byte("<textarea") TagClose = []byte("</textarea>") AttrName = []byte(" name=\"") AttrRows = []byte(" rows=\"") AttrCols = []byte(" cols=\"") AttrAutoComplete = []byte(" autocomplete=\"") AttrDisabled = []byte(" disabled") AttrForm = []byte(" form=\"") AttrMaxLength = []byte(" maxlength=\"") AttrMinLength = []byte(" minlength=\"") AttrPlaceholder = []byte(" placeholder=\"") AttrReadOnly = []byte(" readonly") AttrRequired = []byte(" required") AttrSpellCheck = []byte(" spellcheck=\"") AttrWrap = []byte(" wrap=\"") AttrDirName = []byte(" dirname=\"") )
Byte constants for HTML rendering.
Functions ¶
func New ¶
New creates a new textarea element with optional child nodes Example: textarea.New() Renders: <textarea></textarea>
func RawText ¶
func RawText(content string) *element
RawText creates a new textarea element with raw default text content. Uses text.RawText which is not HTML-escaped. Example: textarea.RawText("Line 1, Line 2") Renders: <textarea>Line 1, Line 2</textarea>
func RawTextf ¶
RawTextf creates a new textarea element with formatted raw default text content. Uses text.RawTextf which is not HTML-escaped. Example: textarea.RawTextf("<b>%s</b>", ipsum) Renders: <textarea><b>ipsum dolor sit amet</b></textarea>
func Static ¶
func Static(content string) *element
Static creates a new textarea element with static default text content. Uses text.Static which is not HTML-escaped and is JIT-optimisable. Example: textarea.Static("Default value") Renders: <textarea>Default value</textarea>