W3C DOM handleEvent utility