copied in html, css and js from working jsfiddle