kriszyp / put-selector

A high-performance, lightweight function for creating and manipulating DOM elements with succinct, elegant, familiar CSS selector-based syntax
Other
290 stars 39 forks source link

SVG Support #32

Open au-phiware opened 8 years ago

au-phiware commented 8 years ago

I have encountered the following error:

Uncaught TypeError: Cannot set property className of #<SVGElement> which has only a getter
(anonymous function)    @   put.js:145
put @   put.js:79

userAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36"

var put = require("put-selector");
put.addNamespace('svg', "http://www.w3.org/2000/svg");
put('svg|g.oops');

For SVG elements you should be using the classList property.