JavaScript code that lines up inner elements of different containers