-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.

2
  • attr Commented Sep 24, 2019 at 18:36
  • .attr("x2","220"); doesn't work... please help... any idea what i've missed Commented Sep 24, 2019 at 18:43

1 Answer 1

0
$('[aria-label="Myline"] svg').attr("x2","220");
Sign up to request clarification or add additional context in comments.

2 Comments

It set the attribute. It does not mean that the line was redrawn.
@SaraRee, you can see that it does. If you have a question about updating the line after the change, feel free to post a new one.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.