Observe and respond to DOM events efficiently