Home
Developers

Developers

  • Documentation
    • Developer Guide
    • API Reference
    • Style Guide
    • How-To
    • Troubleshooting
  • Submit a Flake
  • Support

Pageflakes API Reference

  • Flake System Object
  • Flake User Object
  • Pageflakes Functions
    • DOM Manipulation
    • Element Visibility
    • Element State
    • Class Manipulations
    • Positioning
    • Cursor
    • Progress Bar
    • Element Opacity
    • Cookies
    • Miscellaneous
    • Events
    • Window
    • XML
    • Page
  • Array Extensions
  • String Extensions
  • ContentProxy
  • App
  • RSS
  • Tooltip Manager
  • Public, Shared, and Private Pages
  • Server-Side Scripting
Home » Documentation » API Reference » Pageflakes Functions

DOM Manipulation

$(id)

Shortcut for document.getElementById:


var e = document.getElementById('mytextbox');

Use:

    var e = PF.$('mytextbox');
    var i = PF.$('myradiobutton');
    

$$(tagName, id, className, text)

Shortcut for document.createElement.

The tagName parameter must be specified. All other parameters are optional.


var div = PF.$$('div');
var divButton = PF.$$('div', 'button', 'button_class', 'this is a button');
      

remove(e, p)
remove(id)
Removes the element from the parent node.
removeAll(el) Removes all child elements from the element. It recursively traverses all children and calls remove on them.

Example

This example demonstrates how to perform some simple DOM manipulations, including assigning an element to a variable and removing an element using the PF.Remove method.

  • Download
  • Add To Your Page
‹ Pageflakes FunctionsupElement Visibility ›
»
  • Printer-friendly version