Ashok kumar
Ashok kumar

Reputation: 542

How to change the values of points in polyline dynamically using JQuery?

How to change the points values of polyline dynamically. I know it can done something like this using javascript. But how to do in Jquery?

var id=document.getElementById("id_Value");
id.points[4].y=233;

I have attached a jsfiddle for your reference. JsFiddle Link

Upvotes: 1

Views: 1149

Answers (1)

Paul LeBeau
Paul LeBeau

Reputation: 101918

The jQuery equivalent of your vanilla Javascript code would be:

var id = $("#id_Value")[0];
id.points[4].y=233;

Be aware that there are many problems you may strike when using jQuery to manipulate SVG. jQuery is only designed to work with HTML, not SVG. There are many jQuery functions that don't work on SVG elements.

Upvotes: 2

Related Questions