manipulating content between elements

manipulating content between elements

Hi,

Goal: to manipulate content between elements.
I've found a script where I can find the content between elements, but now I've got the weirdest thing ever: i can't find a way to manipulate it. I know its very simple but I tried everything and nothing works!

What i want is to wrap a <div> around it.

Current script:

var headings = $('h3');

for(var i=0; i < headings.length; i++) {
    var node = headings[i];
    var group = [node];
    for(; node; node = node.nextSibling) {
        if(node == headings[i + 1]);
            break;
        if(node.nodeType == 1)
            group.push(node)
    }
    alert(this); // my group action
}



So, instead of an alert() i want to wrap it with a div. However, I'll get an js error if i do that.

Thanks for the help ppl!

My link is: http://clients.xapss.com/test.html

thx

Maurice[/code]