Cannot bind trigger click on svg path element
I cannot simulate clicking on an svg path element. But other actions like remove () do work.
I have this and it doesn't work:
$("#parentelement").on("click", "someelement", function() {
$('g path[data-code="' + something + '"].jvectormap-region.jvectormap-element').trigger("click");
});
also does not work with .... click()
;
But it works with .remove()
or .trigger("remove")
;
Any ideas or help? Thanx!
+3
source to share
1 answer
You cannot directly bind jQuery events to SVG, but there is a library for that.
Check it out here: jQuery SVG Integration
+5
source to share