JS code
Posted: Wed Nov 19, 2014 2:43 am
Hey guys check out this simple code snippet :
The HTML :
now what does the "index" word hold or represent ? why is it needed ??
The HTML :
Code: Select all
<ul>
<li><strong>list</strong> item 1 - one strong tag</li>
<li><strong>list</strong> item <strong>2</strong> -
two <span>strong tags</span></li>
<li>list item 3</li>
<li>list item 4</li>
<li>list item 5</li>
<li>list item 6</li>
</ul>
Code: Select all
$( "li" )
.filter(function( [color=#BF0000][b]index[/b][/color] ) {
return $( "strong", this ).length === 1;
})
.css( "background-color", "red" );