Preheat your oven to 375°F (190°C). Grease a 9x13-inch baking dish with cooking spray or a bit of butter.
In a large bowl, combine the sliced onions, garlic powder, onion powder, salt, and black pepper. Toss until the onions are evenly coated.
Layer half of the onion mixture in the prepared baking dish.
In a separate bowl, mix together the cheddar cheese, mozzarella cheese, breadcrumbs, and half of the melted butter. Sprinkle half of this cheese mixture over the first layer of onions.
Add the remaining onions on top of the cheese layer, followed by the rest of the cheese mixture. Drizzle the remaining melted butter over the top.
Cover the dish with aluminum foil and bake for 30 minutes.
Remove the foil and bake for an additional 15 minutes, or until the top is golden brown and the onions are tender.
Let cool for a few minutes before serving. Garnish with chopped parsley if desired.