3
Yes, in many ways, for example in your code:
Using the find()
jQuery to find one beaseado element in another:
$( "#panelFormula" ).find( "span" ).css( "background-color", "red" );
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="panelFormula">
<div class="panel-heading">
<span>Fórmula da Critica</span>
</div>
</div>
Finding the element based on its content
$("span:contains(Fórmula da Critica)").css('background-color', 'red');
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="panelFormula">
<div class="panel-heading">
<span>Fórmula da Critica</span>
</div>
</div>
In relation to all the elements, finding the span
specific that you need
$( "span:nth-child(4)" ).css('background-color', 'red');
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="panelFormula">
<div class="panel-heading">
<span></span>
<span></span>
<span></span>
<span>Fórmula da Critica</span>
</div>
</div>
What’s this all about
This is DOM (Document Object model); it is the element tree that makes up HTML; the above techniques are ways to easily find the elements you need to perform your negotiations, legal?
These articles may be useful too:
Thanks, it helped a lot.
– Victor Henrique