appendhtml.js now using DOM 4