JQuery and SVG - how to find the 'g' tag

前端 未结 2 663
既然无缘
既然无缘 2021-01-12 13:06

Imagine this:


    
    

2条回答
  •  心在旅途
    2021-01-12 13:15

    Use find() method for more info visit this

    For eg $("body").find("p").css("background-color","#f00"); sets all body's

    element background-color to red.

    For your question try this:

    $("svg").find("g").click(function(){
    
    // your jquery code here
    
    }
    );
    

提交回复
热议问题