jQuery dom handling implementation