Sol segundo span

De wikiserver
Dreceres ràpides: navegació, cerca
<!DOCTYPE html>
<html>
<head>
<style>
.ancestors * { 
    display: block;
    border: 2px solid lightgrey;
    color: lightgrey;
    padding: 5px;
    margin: 15px;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("body").find("span").eq(1).css({"color": "red", "border": "2px solid red"});
});
</script>
</head>

<body class="ancestors">body 
  <div style="width:500px;">div 
 <span>span </span> 
    <ul>ul 

     
        <span>span </span>
<span>span </span>
      
    </ul>   
  </div>
</body>

</html>