i have searched from hours to find a solution to export a SVG with class on the group element. Is it possible this thing?
I have found a program inkscape which can edit in XML mode and add the attribute. The problem is that inkscape insert too much garbage code to use in the web.
Can it be done in illustrator or program in which the SVG stays with clean code.
Edit - 06.12.2015
For now there is not a good program solution, the best tool to do is inkscape.
For this to work you need to use the XML ediotor in the program, so it is not very user friendly also it includes too much markup in SVG.
This is an explanation by Adobe on how to export SVG from Illustrator CC.
they don't mention classes though.
how about ID's? might be equally useful
Illustrator wraps every layer in a g
element that gets his ID from the layer's name.
you could use it to construct your svg accordingly and get each group of elements with the id you want.
the latest version of AI spits pretty clean code I think.
but you could use an online tool to optimise it.