I am trying to update an HTML table row element with a text and icon. This is what I have tried so far:
const cell = document.getElementById("cellID");
if (true) {
cell.innerHTML = {someText} {<i className="fa fa-exclamation-circle fa-fw" />}
}
Here, cell is a cell in the the HTML table. For example, <td id="someId">some text</td>,
I can update the text easily with cell.textContent = 'newText' but it does not work when I try to add an icon next to the text.
It does not work. How can I add the icon with the text?