How can I shorten this code?

I believe this post will give more context. I suggested the JS could be improved :slight_smile:

2 Likes