I am trying to remove the Title
text from my link while keeping the image.
<tr id="group0">
<td colspan="100" nowrap="" class="ms-gb">
<a href="javascript:" onclick="javascript:ExpCollGroup('28-1_', 'img_28-1_',event, false);return false;">
<img src="/_layouts/15/images/minus.gif" border="0" alt="collapse" id="img_28-1_">
Title
</a>
: How do I access SharePoint settings?
</td>
</tr>
The issue I am facing is this is from a SharePoint site where I don't have much control of the HTML set up before hand, I can only modify it after the page is generated using JQuery. There are about 20 different instances of this code repeated down the page, but each instance has its own img id referenced in both the <a>
tag as well as the <img>
tag that must remain unique, so my attempt to do something along the lines of:
$('.ms-gb a').contents().filter(function() {
return this.nodeType == 3;
}).text();
returns all 20 instances of the " Title". I was thinking of possibly using Jquery to grab the html within the <a>
tag and then to use string splicing to remvoe the last 11 characters but that doesn't seem to be successful so far.