JS to generate boxes