How do I make a jQuery that recognizes if aria-selected="false"
and if true change the background of the "arrow-btn-sub" div to another image (arrow img). This is part of an accordion and I want to change the img of the arrow when the part is open ( <div id="outraDiv">
), the 'area selected' appears inside h3.
<h3>
<a>Banho</a>
<div class="seta-btn-sub"></div>
</h3>
<div id="outraDiv">
<ul>
<li><a href="#">Condicionadores</a><span></span></li>
<li><a href="#">sabonetes</a><span></span></li>
<li><a href="#">shampoos</a><span></span></li>
<li><a href="#">outros</a><span></span></li>
</ul>
</div>
I've done something like this until now, but I still can not make it work as a wish
<script>
if($("#aria-selected").val() == true){
$(".seta-btn-sub").css("background-image","url(images/seta-blue.png);");
}
else if($("#aria-selected").val() == false){
$(".seta-btn-sub").css("background-image","url(images/seta-padrao-azul.png);");
}
</script>