0

So I have searched everywhere I couldn't find an answer to this

thisObj.$playpauseButton.find('svg').attr('viewBox',newSvgData[0]);

<svg focusable="false" aria-hidden="true" viewBox="-40 -130 500 600" viewbox="-28 -140 500 600">

The code here only changes the last viewbox attribute not both of them, How can I select both or select the first one only?

ankitkanojia
  • 2,962
  • 4
  • 20
  • 35
iceman2894
  • 45
  • 1
  • 8

2 Answers2

0

I have found a workaround to use setAttribute() as it's case sensitive.

As in here

$('.able-button-handler-play').find('svg')[0].setAttribute('viewBox','-28 -140 500 600');
iceman2894
  • 45
  • 1
  • 8
0

You could also jQuery eq

Now, your script should look like this

$('.able-button-handler-play').find('svg').eq(0).setAttribute('viewBox','-28 -140 500 600');
Qonvex620
  • 3,575
  • 1
  • 5
  • 15