getting class of SVG element using Javascript

J

Jacqueline Snook

Hi,

I am working on a website that uses a SVG diagram with multiple
polygons (to represent rooms in a hotel). Each polygon has a class to
represent whether the room is single or double. In a separate
javascript file, I need to do a different action depending on the
class. How do I read the class in the Javascript file. I tried using
getAttribute("class"), but this does not work - IE comes up with an
error stating 'The object doesn't support this property or method'.

Any help would be greatly appreciated as this is doing my head in!!

Jacqueline
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top