I would like to know if there is way to modify the attributes of html element in the editor without having to use the pasteHtml function. It appears that both internal dialogs (e.g. image manager, table properties) and custom dialogs insert new html to reflect the changes that occurred in the dialog (e.g. table borders, image alt text). The issue I am having is that the new html isn't always being inserted in the same location in the editor as the tag that launched the dialog. See examples below:
Example 1
Before: This is what the html looks like before modifying the table border using the Table Properties dialog.
<p>This is a paragraph<sup>1</sup>:</p>
<table >
<tbody>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
</tbody>
</table>
<p>
<sup>a</sup> Footnote for table 1.</sup>
</p>
After: Applying table border
<p>This is a paragraph<sup>1</sup>:</p>
<p>
<sup>
<table bordercolor="#000000" border="1">
<thead/>
<tbody>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
</tbody>
</table>
a
</sup> Footnote for table 1.
</p>
The table is inserted in the sub tag of the second paragraph.
I also have the same problems with images being moved around after changing the alt text using the image manger.
Is there way to modify the attributes of an existing element in the editor while maintaining its exact location?
Thanks,
Alex