My javascript skill are a bit dated so I want to consult your for a best practice advice.
What I want to achieve: