Updated sample code in JsFiddle