I have an unordered list of all the features of each product.
Some of those features are blank though, as in Not-Applicable.
So I want to add a class of "my-hidden" to those rows which have a value of "-"
So the DOM looks like this.
HTML Code:
<ul id="mylist">
<li><span>Label One</span> - </li>
<li><span>Label Two</span> foobar </li>
<li><span>Label Three</span> - </li>
<li><span>Label Three</span> foobar </li>
</ul>
I want to attach the class of "my-hidden" to the first and third <li>.
I'll then use CSS to do the rest.
How can I do that? I assume i need some kind of "for each" loop that
looks at all the <span> siblings and compares whether they contain the text "-" ?
Anyone?
__________________
Please login or register to view this content. Registration is FREE "Order a PEBBLE Smart Watch for Bluetooth connection to your iPhone or Android" - 100% Waterproof - 7+ days Battery Charge - High Res Outdoor Readable - Vibrating Alert - Incoming Caller ID
Last edited by TWD; 04-11-2012 at 11:10 PM..
|