Yes thank you.
Incidently, I just found a .wrapText() method in the jQuery
MoreSelectors plugin that does the same thing!
// Plugin to wrap html around non-empty text node(s) within an
element:
// (ignores text in child elements)
// Eg: $("LI").wrapText("<LABEL/>")
// Before: "<li><input/>some text</li>"
// After: "<li><input/><label>some text</label></li>"
jQuery.fn.wrapText = function(html){ // Returns jQuery object so
chaining is not broken.
return this.each(function(){
jQuery(this.childNodes).filter("[EMAIL
PROTECTED]").each(function(){
if(jQuery.trim(this.nodeValue).length > 0)
jQuery(this).wrap(html);
})
});
};
Now, if I can use this model to just find the last "leaf" nodes of the
ul/li/a tree!
Ideally, all the A tags without a UL child. Thats what I'm working
on now. :-)
PS: Nice emCalc thing you have! Just wondering if what you showed is
just a small piece of a total package because you can easily add text
node to the right each node to illustrate the current sizes.
--
HLS
On Sep 9, 1:13 am, "Piotr Petrus" <[EMAIL PROTECTED]> wrote:
> jQuery originally works on element nodes, but text nodes are rightful
> members of DOM too. :)
> Glad I could help.
> --
> Piotr Petrushttp://riddle.pl