Stamen Georgiev schrieb:
> Forgive me my stupid question... but is there an easy way to turn this:
> 
> <a href="#">some text</a>
> 
> into this:
> 
> <a href="#"><div class='someclass'>some text</div></a>
> 
> It's some kind of wrap... but from the inside :-)


If you use a <span> to wrap inside, than, yes, there is a way. Otherwise 
not, because a <div> is not allowed inside an <a> ;-)

Try this:

$('a').each(function() {
     var a = $(this);
     a.html('<span>' + a.html() + '</span>');
});

If you want the span to be rendered as a block element add this to your 
style sheet:

a span {
     display: block;
}

If I remember correctly there is also a wrapInner plugin on the plugin 
page...


-- Klaus

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to