You could use querySelector()
with attribute selector '[attribute="value"]'
, then affect css rule using .style
, as you can see in the example below:
document.querySelector('a[aria-expanded="true"]').style.backgroundColor = "#42DCA3";
_x000D_
<ul><li class="active">_x000D_
<a href="#3a" class="btn btn-default btn-lg" data-toggle="tab" aria-expanded="true"> <span class="network-name">Google+ with aria expanded true</span></a>_x000D_
</li>_x000D_
<li>_x000D_
<a href="#3a" class="btn btn-default btn-lg" data-toggle="tab" aria-expanded="false"> <span class="network-name">Google+ with aria expanded false</span></a>_x000D_
</li>_x000D_
</ul>
_x000D_
jQuery solution :
If you want to use a jQuery solution you could simply use css()
method :
$('a[aria-expanded="true"]').css('background-color','#42DCA3');
Hope this helps.