Search code examples
javascriptjquerysvgjquery-svg

Grabbing the ID attribute of a selected element within my svg-canvas. SVGEDITOR and Methoddraw


I would like to get the id of a selected element within my svg-canvas as a variable to use it within a function. I would take it that var selected = svgCanvas.getSelectedElems; doesn't pass a particular id. Any ideas?


Solution

  • You can make direct use of selectedElement.id

    var elementSel = selectedElement.id;