function swap()
{
var barElements = document.getElementsByTagName("bar");
var child1 = barElements[1];
dump("child1 = " + child1 + "\n");
var child2 = barElements[2];
dump("child2 = " + child2 + "\n");
var parent = child1.parentNode;
dump("parent = " + parent + "\n");
parent.insertBefore(child2, child1);
}
function toggleColor()
{
var barElements = document.getElementsByTagName("bar");
var child1 = barElements[1];
if (child1.getAttribute("enabled")) {
child1.removeAttribute("enabled");
}
else {
child1.setAttribute("enabled", "true");
}
}
This
is
really
great