If I want to replace many times an element with an id like this :
$("#anIdElement").replacewith("#anotherIdElement");
This shouldn't work, so my question is : What can be used to replace many times a specific element with another another.
Example :
<table>
<tr>
<td id="theFirsttd">Original content</td>
</tr>
<tr>
<td id="atd">Replace the current content by the original</td>
</tr>
<tr>
<td id="atd">Replace the current content by the original</td>
</tr>
</table>
The problem here is that I can't replace the element with the id named atd, I can only once. Am I right ?
So, is it possible to use something like remove()
then append()
to get it ?