fix bug: toHTML produces the problem of event binding