I have a tag list that has mostly tags that start with a hyphen. I want to remove or hide all tags that DO NOT have this character. Because of limited access to code, it has to be done with jQuery/javascript. My attempt doesn't work, how to fix?
Here is my HTML:
<div class="widget Label" data-version="2" id="Label1">
<h3 class="title">
Tags
</h3>
<div class="widget-content cloud-label-widget-content">
<span class="label-size label-size-5">
<a class="label-name" href="https://about.xarcell.studio/search/label/art">
art
<span class="label-count">
10
</span>
</a>
</span>
<span class="label-size label-size-5">
<a class="label-name" href="https://about.xarcell.studio/search/label/-gallery">
-gallery
<span class="label-count">
9
</span>
</a>
</span>
<span class="label-size label-size-5">
<a class="label-name" href="https://about.xarcell.studio/search/label/-photography">
-photography
<span class="label-count">
9
</span>
</a>
</span>
<span class="label-size label-size-5">
<a class="label-name" href="https://about.xarcell.studio/search/label/-portfolio">
-portfolio
<span class="label-count">
9
</span>
</a>
</span>
<span class="label-size label-size-5">
<a class="label-name" href="https://about.xarcell.studio/search/label/opinion">
opinion
<span class="label-count">
9
</span>
</a>
</span>
</div>
</div>
Javascript:
$('#label1').each(function() {
$('#label1 span').find(':not(:contains("-"))').remove();
});