I'm trying to find a way to loop through a list with Jquery, and if a certain class has text of "Not Complete", replace the words "Not Complete" with a animated gif.
Here's the list:
<ul>
<li class="name">Name</li>
<li class="job">This</li>
<li class="status">Not Complete</li>
</ul>
The list is populated via a php script.
I tired this from another example here, but couldn't get it to work:
function change(){
if($('.status').text=='Not Complete')
{$('.status').replaceWith('<img src='loading.gif' />');}
else{}
}
$(function() {
$(".status").each(change);
});
Any idea's of how I could get this working?