-1

Here is what I can see in chrome inspector. it's a simple line element.

How can I modify x2="120"? and change it to 220 for example?

<line id="uniqueDomId-276" x1="0" y1="0" x2="120" y2="0" stroke-width="1" stroke="#385D8A" stroke-opacity="1" stroke-linecap="flat" stroke-linejoin="round" data-stroke-sharpened="true" transform="translate(0.5, 0.5)" data-accepts="events" data-reactid=".0.0.3.2.0.1.0:$_player=16czu6OSdRsI=16IS5kYU7fKF.0.3:$c234.1:$c255.$slideobject274.$0.$0.$0"></line>

Note: I can select the line element using this code:

var item = $('[aria-label="Myline"] svg')

I just wonder how to change the x2 attribute of it.

Sara Ree
  • 3,417
  • 12
  • 48

1 Answers1

0
$('[aria-label="Myline"] svg').attr("x2","220");
PaulProgrammer
  • 16,175
  • 4
  • 39
  • 56
  • It set the attribute. It does not mean that the line was redrawn. – PaulProgrammer Sep 24 '19 at 18:40
  • @SaraRee, [you can see that it does](https://jsfiddle.net/isherwood/n0jtp7a2/). If you have a question about updating the line after the change, feel free to post a new one. – isherwood Sep 24 '19 at 18:46