Does the attr() in jQuery force lowercase?

后端 未结 4 755
广开言路
广开言路 2020-12-03 20:29

I\'m trying to manipulate the svg \'viewBox\' attribute which looks something like this:

 ...          


        
4条回答
  •  情歌与酒
    2020-12-03 21:09

    you want to make sure you remove the attr if it already exists before manipulating it

    $("svg").removeAttr("viewBox")
    

    and then recreating it

    $("svg").attr("viewBox","...");
    

提交回复
热议问题