Module: DOM::Document
- Extended by:
- SingleForwardable
- Defined in:
- opal/fron/dom/document.rb
Overview
This module is a wrapper for the native document object.
Class Method Summary collapse
-
.activeElement ⇒ DOM::Element
Returns the active element.
-
.body ⇒ DOM::Element
Returns the body element.
-
.head ⇒ DOM::Element
Returns the head element.
-
.title ⇒ String
Returns the documents title.
-
.title=(value) ⇒ Object
Sets the documents title with the given value.
Class Method Details
.activeElement ⇒ DOM::Element
Returns the active element
12 13 14 |
# File 'opal/fron/dom/document.rb', line 12 def self.activeElement find ':focus' end |
.body ⇒ DOM::Element
Returns the body element
26 27 28 |
# File 'opal/fron/dom/document.rb', line 26 def self.body @body ||= find 'body' end |
.head ⇒ DOM::Element
Returns the head element
19 20 21 |
# File 'opal/fron/dom/document.rb', line 19 def self.head @head ||= find 'head' end |
.title ⇒ String
Returns the documents title
33 34 35 |
# File 'opal/fron/dom/document.rb', line 33 def self.title `document.title` end |
.title=(value) ⇒ Object
Sets the documents title with the given value
40 41 42 |
# File 'opal/fron/dom/document.rb', line 40 def self.title=(value) `document.title = #{value}` end |