Update classes.js

Replaced the use of className attribute with get/setAttribute to enable support for *Class functions with SVG elements (see bug #10329).