The idea took root after Jenni Spinner and her wife, Rebecca Kell, watched videos of Europeans, homebound because of the coronavirus, get on their balconies and sing to raise their spirits in the face of crisis.

Wouldn’t it be neat, they mused, if they could get the residents of their Chicago apartment building to do something similar?

Ms. Spinner said she figured a handful of friends might be game for a karaoke-style communal singalong to “Livin’ on a Prayer” by Bon Jovi, which they said was easy to sing and well known. Thus, a Facebook event page for a “Chicago-Wide Window Sing-a-Long” on March 21 was born.

Three days before it was set to take place, 100 people responded that they either planned to participate or were interested in doing so. By the night of the event, that number had swelled to 19,000.