I am currently working on a task that involves extracting the first <li>
element's id
where it has the class name my_class
, and checking if the <span>
with the class Time
contains a ":
" using jquery.
Below is the sample HTML structure:
<ul class="list">
<li id="myID-1" class="">
<span class="Time">00h : 10m</span>
</li>
<li id="myID-2" class="my_class">
<span class="Time">01h : 08m</span>
</li>
<li id="myID-3" class="my_class">
<span class="Time">waiting</span>
</li>
</ul>
Javascript:
var ID = $(".my_class").attr("id");
The challenge now is how to filter the results based on the class Time
.
Is there anyone who can assist me in solving this issue?