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
  • 3,072
  • 4
  • 22
  • 35
iceman2894
  • 67
  • 1
  • 9

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
  • 67
  • 1
  • 9
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,819
  • 1
  • 8
  • 15