There really isn’t a dress code for online classes. Especially the synchronous ones. For the asynchronous ones, no one cares because you are never on camera.
But the synchronous ones. That is another story.
I have heard stories of barely dressed students, smoking students, and clearly hungover students.
Remember, you are paying money to do this class. It is best to act like it.
The program I am in started every other week in person at the university. I wore a version of librarian casual. One of my nicer tee shirts, slacks, or a skirt. When I was working as a research assistant my dress was dressier. Nice sweater, slacks, or skirt. I never wore a graphic tee to do RA work. I was being paid to do the work and there I should dress the part.
However, for my online classes that meet every Friday, I make sure I am 1) wearing a bra, 2) wearing an inoffensive tee shirt, and 3) bottoms. In the hot months, the bottoms are either shorts or a skirt. In the colder months, then it is probably pajama bottoms.
This last one is the most important.
Some people do not wear bottoms. After all, the camera only shows from just under the clavicle and your head.
But what if there is an emergency and you are not wearing bottoms?
You will give your professor and your class something to talk about for sure.
Keep it covered. Keep it classy.
Be prepared for emergencies.
Or the doorbell.
Whichever comes first.
Whatever you are comfortable being seen in is best.