generate an html element (tag, attr, contents) string