The string passed in document.createElement is the type of the element, for example. tr .
If you really want to assemble your HTML as a large string, I suppose you could write:
var newRow = document.createElement('tr'); newRow.innerHTML = "<td align='left' valign='top' width='9%;' ><img width='32px' height='32px' src='images/" + ProfilePic + "' /></td><td align='left' valign='Top' ><span class='MsgSpan'>" + Msg + "</span></td><td align='right' align='left' valign='top' style='color:Gray;' >" + Date + "</td>";
but perhaps cleaner / faster / safer to use DOM manipulation for everything.
source share