0

I'm trying to change the value of the 'd' attribute on the path element but it doesn't change, no error is thrown - Demo.

HTML:

<path class="slds-progress-ring__path" data-id="slds-progress-ring-path-1" d="M 1 0 A 1 1 0 0 0 1 -2.4492935982947064e-16 L 0 0"></path>

JS:

this.template.querySelector('path[data-id=slds-progress-ring-path-1]').d = 'M 1 0 A 1 1 0 0 0 -0.8090169943749475 -0.587785252292473 L 0 0';

Demo

2

You need to use element.setAttribute method to set the elements property. Directly assigning a value is not supported.

this.template.querySelector('path[data-id=slds-progress-ring-path-1]').setAttribute("d", "M 1 0 A 1 1 0 0 0 -0.8090169943749475 -0.587785252292473 L 0 0");
1
  • thanks again Anmol Kumar – Json Mar 18 '20 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.