I run a website that compiles video clips from various sources, including YouTube. Occasionally, some clips appear as private videos. I am looking to use jQuery to apply the display:none;
property to the entire div
when the class a.colorbox.cboxElement
contains the text "Private video". How can I achieve this?
In the past, I have managed to add an extra class to individual div
elements in order to remove them, but I am uncertain about how to handle nested elements:
$( "#div:contains('text')" ).addClass( "newclass" );
The HTML structure is as follows:
<li class="feed-item">
<div class="thumbnail-excerpt wprss-feed-thumbnail sgvtagged">
<div class="SGVthumb SGVthumb-0" data-title="SKateFlix" data-desc="The Amazing SkateFlix" data-type="yt" style="width:280px;height:210px;float:left;padding-right:px" data-media="SGVvideo" data-thumb="http://www.youtube.com/embed/2A7vCq8BmQQ" data-yid="2A7vCq8BmQQ" data-image="0" data-video="http://www.youtube.com/embed/2A7vCq8BmQQ?wmode=opaque&autoplay=1&rel=0"><img height="210" width="280" src="http://skateflix.se/wp-content/uploads/cache/remote/www-gstatic-com/3140846889.png"><img class="mpover" src="http://skateflix.se/wp-content/plugins/sgvideo/img/ytp.png" style="left:40px;top:40px"></div>
</div>
<div class="source-date"><span class="feed-source">VANS </span></div>
<a class="datum">onsdag, maj 6</a>
<a class="colorbox cboxElement" href="http://www.youtube.com/embed/2A7vCq8BmQQ">Private video</a>
<div class="colorboxexcerpt" href="http://www.youtube.com/embed/2A7vCq8BmQQ">...</div>
</li>