In the following html, can I hide the content starting from ( and ending at ) using CSS or jQuery. The problem I’m facing is that the ( and later code is not wrapped in any div, so I can not use CSS to find the div class and set display:none.
<span>
<a class="test" href="#">test</a>
(<a href="#">?</a>)
</span>
$('span a:not(".test")').hide();will work on your limited example.However, it won’t hide the parentheses. To do that, you’ll need a specialized function to remove just the code you don’t want:
http://jsfiddle.net/pkMgP/
If you want to hide that instead of removing it, you’ll need to wrap it all up in an HTML element and apply styles to that:
http://jsfiddle.net/pkMgP/1/