I have an element that is already present on the page with HTML as a string. How can I take the text from that element and convert it into HTML and re-inject it back into the existing element?
Everything I try re-renders the elements innerhtml as text.
window.current_element_content=window.current_element.previousElementSibling.innerHTML;
window.current_element.previousElementSibling.getElementsByTagName('div').innerHTML = window.current_element_content;
Example of the text when printed on the console.
<tr>
<td headers="mon">
9:00 AM - 4:00 PM
</td>
<td headers="tues">
9:00 AM - 4:00 PM
</td>
<td headers="wed">
9:00 AM - 4:00 PM
</td>
<td headers="thurs">
9:00 AM - 4:00 PM
</td>
<td headers="fri">
9:00 AM - 4:00 PM
</td>
<td headers="sat">
Closed
</td>
<td headers="sun">
Closed
</td>