emit events while building the dom