Get svg image path id from object

by satheeshkumar 2014-05-27 18:22:53

By using addEventlistener you can get svg image path id which included using object,

<object data="svgimage.svg" type="image/svg+xml" id="alphasvg" ></object>
<script>
var a = document.getElementById("alphasvg");
	a.addEventListener("load",function(){
            var svgDoc = a.contentDocument; 
            var svgId = $(svgDoc).find("path_id");
           alert(svgId); //you will get all the id inside svg image
},false);
</script>
1210
like
0
dislike
0
mail
flag

You must LOGIN to add comments