Let <span><a href= "#" ></a></span> This structure has text display a color, no text to display another color ...
<style type= "Text/css" >
*{margin:0; padding:0; font-size:12px;}
body{background: #EEE;}
a{color: #666;}
li{List-style:none;}
ul{width:500px; height:230px background: #fff; margin:50px auto;}
UL li{width:500px; height:auto; overflow:hidden; margin-bottom:5px;}
UL Li span{display:block; float:left; width:100px; height:20px;}
</style>
<ul>
<li><span><a href= "#" > "Special" </a></span><a href= "#" >2005 the Queen Bein plastic accident death </a> </li>
<li><span><a href= "#" ></a></span><a href= "#" >2005 years Queen 贝因 plastic Surgery accidental death </a></ Li>
</ul>
Let <span><a href= "#" ></a></span> This structure has text to display a color, no text to display another color of the JQ code is as follows:
<script type= "Text/javascript" >
$ (function () {
$ ("ul Li span"). each (function () {
if ($ (this). Find ("A:eq (0)"). Text () = "") {
$ (this). CSS ("Background", "blue");
}else{
$ (this). CSS ("Background", "Red");
}
});
});
</script>