background-check icon indicating copy to clipboard operation
background-check copied to clipboard

Uncaught TypeError: className.replace is not a function

Open stevepiron opened this issue 9 years ago • 1 comments

I have tried with different target classes and the error keeps occurring. On init I get "Uncaught TypeError: className.replace is not a function". My target class is on a tag and I have tried removing all the classes except the target class but it still doesn't work.

Any idea why? Thanks!

stevepiron avatar Jan 29 '16 09:01 stevepiron

I struggled with this error too, and isolated it to the particular element attached to the target class selector. In my case it would be 'svg'. It would give me this error if I use it on that element. So I just wrapped it in and put the targetClass there. Make sure you put some content in there if svg (like an nbsp for example), so it would think it's not an empty container.

Or you can add it to the wrapping parent element, then just style it accordingly:

parent.targetClass > targetElement background-dark: #000

Hope that helps.

ghost avatar Feb 17 '17 21:02 ghost