How to programmatically trigger click event in svg rectangle element element? like :$(\"#targetElm\").triger(\"click\");
How about this
document.getElementById("targetElm").dispatchEvent(new Event('click'));
Here's a working example...
document.getElementById("targetElm").dispatchEvent(new Event('click'));
i.e. create a click event and dispatch it to the element. Although you don't seem to have any handler for the click event in your question.