added dom and jquery solution