You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<table>
<tr>
<td>
<span id='elm'>X</span> some text
</td>
</tr>
</table>
and apply the following javascript code to it:
Element.replace('elm', '<span>Y</span>')
Expected result:
The table cell should change from X some text to Y some text
Actual result:
By replacing the span it gets swapped with the textNode "some text".
So the table cell reads: some text Y
This will not happen though, if the span 'elm' is followed by an html tag (<span>, <b> or whatever).
The text was updated successfully, but these errors were encountered:
Chris78
changed the title
Element.replace swaps element and textNode if used inside a table
Element.replace() swaps element and textNode if used inside a table
Feb 2, 2023
Consider the following table:
and apply the following javascript code to it:
Expected result:
The table cell should change from X some text to Y some text
Actual result:
By replacing the span it gets swapped with the textNode "some text".
So the table cell reads: some text Y
This will not happen though, if the span 'elm' is followed by an html tag (
<span>, <b>
or whatever).The text was updated successfully, but these errors were encountered: