DOMhelp test page

DOMhelp is a small collection of helper methods in one DOMhelp object, and is meant to ease working with the DOM and circumvent some of the browser issues we encounter every day.

Following is a list of nodes we apply DOMhelp methods to, to see if it will fail in some browsers. The nodes feature linebreaks, tabs and embedded elements to stress-test the methods.

Here are some test links for the methods (as evil inline event calls), give them a go - the ones that should retrieve elements will display their text content in the debugger:

These are all the methods of DOMhelp (apart from the classics like addEvent, cssjs, cancelClick and getTarget):

DOMhelp={
  // find the last sibling of the current node
  lastSibling:function(node){},   
  // find the first sibling of the current node
  firstSibling:function(node){},
  // retrieve the content of the first text node sibling of the current node
  // find the next or previous sibling that is an element and not a text node or linebreak
  closestSibling:function(node,direction){},
  getText:function(node){},
  // set  the content of the first text node sibling of the current node
  setText:function(node,txt){},
  // find the next or previous sibling that is an element and not a text node or linebreak
  createLink:function(to,txt){},
  // create a new element containing a given text
  createTextElm:function(elm,txt){},
  // simulate a debugging console to avoid the need for alerts
  initDebug:function(){},
  setDebug:function(bug){},
  stopDebug:function(){},
}