Rct567/DomQuery

AppendTo doesn't work properly

LoranRendel opened this issue · 1 comments

$html = new DomQuery('<div class="container">');
$div = DomQuery::create('<div id="el1">')->appendTo($html);
DomQuery::create('<div id="el2">')->appendTo($div);
echo $html;

Expected:

<div class="container"><div id="el1"><div id="el2"></div></div></div>

Got:

<div class="container"><div id="el1"></div><div id="el2"></div></div>

JS function works as expected:

var html = $('<div class="container">');
var div = $('<div id="el1">').appendTo(html);
$('<div id="el2">').appendTo(div);
console.log(html[0].outerHTML);

@LoranRendel I had fix it in my repository. edwinhuish/DomQuery