[](id) public

Returns a element reference by finding it through id in the DOM. This element can then be used for further method calls. Examples:

  page['blank_slate']                  # => $('blank_slate');
  page['blank_slate'].show             # => $('blank_slate').show();
  page['blank_slate'].show('first').up # => $('blank_slate').show('first').up();

You can also pass in a record, which will use ActionController::RecordIdentifier.dom_id to lookup the correct id:

  page[@post]     # => $('post_45')
  page[Post.new]  # => $('new_post')
Show source
Register or log in to add new notes.
September 9, 2008 - (<= v2.1.0)
4 thanks

Reset a form

To reset a form easily you can do the following: