ensure el.className is a string before calling indexOf

el.className is an object if el is inside an svg