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

Class Method Details

.activeElementDOM::Element

Returns the active element

Returns:


12
13
14
# File 'opal/fron/dom/document.rb', line 12

def self.activeElement
  find ':focus'
end

.bodyDOM::Element

Returns the body element

Returns:


26
27
28
# File 'opal/fron/dom/document.rb', line 26

def self.body
  @body ||= find 'body'
end

.headDOM::Element

Returns the head element

Returns:


19
20
21
# File 'opal/fron/dom/document.rb', line 19

def self.head
  @head ||= find 'head'
end

.titleString

Returns the documents title

Returns:


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

Parameters:

  • value (String)

    The title


40
41
42
# File 'opal/fron/dom/document.rb', line 40

def self.title=(value)
  `document.title = #{value}`
end