DOM manipulation for deleting the table but not what is inside that.
Can anyone help me to re format my articles in DOM by jquery?
I have articles that the image of the content is in a table row and the caption for image in another row. Now I need to change the format from this first example to the second one.
For this I need take out the table but use the (img src) and the image caption.
First example:
...
<table style="width: 300px;" border="0" align="left">
<tbody>
<tr>
<td><img src="/images/image1.jpg" border="0" /></td>
<td></td>
</tr>
<tr>
<td><em>The image caption.</em></td>
<td></td>
</tr>
</tbody>
</table>
<p>Article's main text continues here...</p>
...
Second example:
<p><img class="caption" src="images/image1.jpg" border="0" alt="The image caption." title="The image caption." align="left" />
Article's main text continues here...</p>
</p>