switch do DOM based approach