Interlaced Grey

2018-10-07  本文已影响0人  Jadon7
<!DOCTYPE html>
<html>
<head>
    <title>Interlaced Grey</title>
</head>
<script type="text/javascript">
    window.onload=function()
    {
        var aLi=document.getElementsByTagName('li');
        for (var i = 0; i < aLi.length; i++) 
        {
            if (i%2==0) 
            {
                aLi[i].style.background='#EEE';
            }
            else
            {
                aLi[i].style.background='';
            }
        }
    }
</script>
<body>
<ul>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
</ul>
</body>
</html>
上一篇 下一篇

猜你喜欢

热点阅读