i am currently learning jQuery. Problem: I have three component in the container. Initially all font color are black. I would like to change the font color according to the class name of each div.
I able to change two of them while fail to change all. My code are belows:
index.html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div class="container">
<div class="Red">old content</div>
<div class="Black">old content</div>
<div class="Blue">old content</div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="index.js"></script>
</body>
</html>
index.js
$(document).ready(function(){
$('.container div')
.delay(10000)
.css("color","Blue")
.delay(10000)
.filter(".Red")
.css("color", "Red")
.delay(10000)
.filter(".Black")
.css("color", "Black");
});
Please advice.