I think you want .wrap():
$("#somediv").wrap('<table><tr><td></td></tr></table>');

--John

On Thu, Feb 21, 2008 at 8:38 PM, jquertil <[EMAIL PROTECTED]> wrote:
>
>  hello again...
>
>  why would this work...
>  $('#somediv').before('I am just text').after('I am also just text');
>  result:  I am just text<div id="somediv">...</div>I am also just text
>
>  but this would not?
>  $('#somediv').before('<table><tr><td>').after('</td></tr></table>');
>  result: <table><tr><td></td></tr></table><div id="somediv">...</div>
>
>  does jQuery not like incomplete, i.e. unclosed tags?
>
>  ::scratching head::
>

Reply via email to