'KivyMD: Referencing multiple widgets with a single identifier

In KivyMD, normally you reference single widgets in the Python file through their id (i.e. id: widget1). I would like to know if there is a way to reference multiple widgets with a single identifier.

For example: In HTML, CSS, and JavaScript, you can access multiple HTML elements in JavaScript using a class name, which then groups them together in a collection. I'm looking for something similar to this feature.

This is just an example of what I wanted to try. However, group only applies to MDCheckBoxes, and there's no way to access the widget in the Python file based on the group name.

Widget1:
    group: 'group1'
Widget2:
    group: 'group1'


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source