Class: FormElements::Label

Inherits:
ContainerElement
  • Object
show all
Defined in:
lib/reparcs/elements/form_elements.rb

Overview

A Label element

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Label

Creates a new Label element, takes an optional hash of attributes as parameter.



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/reparcs/elements/form_elements.rb', line 104

def initialize(attrs={})
  aattrs = [
    "class", "id", "title", "dir", "xml:lang",
    "onclick", "ondblclick", "onkeydown", "onkeypress",
    "onkeyup", "onmousedown", "onmousemove", "onmouseout",
    "onmouseover", "onmouseup", "for"
  ]
  childs = [
    "a", "abbr", "acronym", "b", "bdo", "big", "br", "button",
    "cite", "code", "del", "dfn", "em", "i", "ins", "kbd",
    "label", "map", "object", "q", "samp", "script", "select",
    "small", "span", "strong", "sub", "sup", "textarea",
    "tt", "var"
  ]
  super("label", aattrs, childs, attrs)
  @start_element = "<label"
  @end_element = "</label>"
end