Use document.createElement instead of html string

Use `document.createElement` instead of html string for element creation, fixes #336.