Is there a way to use onclick to load something on the page?

Hello,
I am using onclick to expand a box element and in the box element there is HTML code of Soundcloud embed player.
But since I have lots of boxes on one page, Soundcloud player does not load properly.
So is there a way to use the onclick to expand and load at the same time rather than loading them all at the back end?

Thank you.