-1

html

<svg>
  <polyline points="0,0 100,100" style="fill:none;stroke:black;stroke-width:3"/>
</svg>

jquery

 $("svg").css("width",$(document).width());
        $("svg").css("height",$(document).height()-10);
    $("polyline").click(function(){

        alert($(this).attr("points"));

    });

result

<-- alert -->

object SvgPointList

Question

How to get attr svg points?

1 Answers1

0

why not try getting 'points' attribute using simple javascript

i am giving id to polyline

<polyline id="polyline_1" points="0,0 100,100" style="fill:none;stroke:black;stroke-width:3"/>

now Javascript:-

var polyline =document.getElementById('polyline_1');
var points=polyline.getAttribute('points');

it will return string.

RashFlash
  • 992
  • 2
  • 20
  • 40