I have this code in HTML
<span id="s">Attachments</span>
How to use jQuery to switch the outer SPAN element with the following table code block, so that the “Attachments” text becomes wrapped with the table element.
<table id="t">
<tr>
<td>Attachments</td>
</tr>
</table>
You could create a table with a tr and td, insert the HTML contents from the span into that new td element, insert the table immediately after the span, and then finally, remove the span.
I’m assuming by “swipe” you mean “swap”? So that’s why I’ve removed the original span. If this is not the case, just leave out the
removecall.