Depends what class it is. If it's something required that you don't like or care about, I'd take it online. But I believe you'd get a much better understanding by attending class each time.
During my year at a community college, I took two online courses. The first was Rhet & Comp, since I hate English and writing essays. All I had to do was login once or twice a week to get some assignments and write up essays. Much better than wasting my time in class having the teacher read me the assignment. Even better was Macroeconomics. All that was required all semester was approx 15-18 Chapter Quizzes that were timed at 30 minutes, but you got to use the book! There was no deadlines, as long as you finished all of the quizzes by the end of the semester. So you could do the whole class in a day if you felt like it. Well, maybe a couple days.