this causes double read of attributes on node. Accessing DOM is expensive, and so it should be minimized. There is another loop which already reads attributes, and we should do the `on-*` check there.