Problem/Motivation
I have used such command$ajax_response->addCommand(new ReplaceCommand($selector, '<td>Hello!</td>'));
but in result i see only - "Hello!", without tags
Steps to reproduce
Replace one cell not working.
// Not working.
$ajax_response->addCommand(new ReplaceCommand($selector, '<td>Hello!</td>'));
Replace one table working.
// Working.
$ajax_response->addCommand(new ReplaceCommand($selector, '<table><tr><td>Hello!</td></tr></table>'));
Proposed resolution
from https://stackoverflow.com/a/43112816
var template = document.createElement( 'template' )
template.innerHTML = '<td></td>'
var frag = template.content
console.log( frag.childNodes ) // output => [td]