I am setting a variable to the full contents of a <tbody>, after filtering the table I want to be able to return to the original full contents of the <tbody>. Currently, when I try to change back to the original contents, jQuery is stripping the <script> <tr> and <td> elements.
JavScript
var contents= $("tbody").html();
//load of other functions
$("tbody").html(contents);
The contents looks a bit like this:
<script>alert("Hello");</script>
<tr>
<td>A value</td>
<td>Another value</td>
</tr>
When I attempt to revert back to this contents I get:
A value
Another value