Class: FormElements::Option

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

Overview

A option element ‘<option></option>’

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Option

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



188
189
190
191
192
193
194
195
196
197
198
# File 'lib/reparcs/elements/form_elements.rb', line 188

def initialize(attrs={})
  aattrs = [
    "class", "id", "title", "dir", "xml:lang",
    "onclick", "ondblclick", "onkeydown", "onkeypress",
    "onkeyup", "onmousedown", "onmousemove", "onmouseout",
    "onmouseover", "onmouseup", "style", "value"
  ]
  super("option", aattrs, [], attrs)
  @start_element = "<option"
  @end_element = "</option>"
end