how to display two li in time intervel using jquery

Posted by abc on Stack Overflow See other posts from Stack Overflow or by abc
Published on 2011-01-04T05:44:27Z Indexed on 2011/01/04 5:53 UTC
Read the original article Hit count: 227

Filed under:
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.js"></script>
<style type="text/css">
body
{
color:green;
}
</style>
<script type="text/javascript">
$(document).ready(function()
{
 setInterval(findYellow,1000);    
 function findYellow()
{
  $("ul").each(function()
{
   var $this = $(this);
   if($this.css("color") != "green")
{
    $this.css("color", "green");
   $this.text("abcd blue");
   }
else
{
    $this.css("color", "blue");
     $this.text("abcd green");
   }
  });
 }

});
</script>
</head>



    <body>
        <ul>This is a sample set
            <li>1</li>
            <li>3</li>
            <li>5</li>
            <li>7</li>
            <li>9</li>
        </ul>

    </body>
</html>

© Stack Overflow or respective owner

Related posts about jQuery