I am trying to insert (add) to an element ... "body" specifically.
I can do it this way at the moment:
$var = "some JS stuff";
$e = $htmlDOM->find("body", 0);
$e->outertext = '<body>' . $e->innertext . $var . '</body>';
My problem is that this fixes <body>, but the actual html may have js or id, etc. attached to <body>, and I would like to support this if that is the case.
The docs don't seem to show a method for this.
Is it possible?
source
share