html - jquery to remove text in a page -
i wish remove text "documenttype :" following html (i not concerned title or alt):
<tr class="ms-gb" ishdr="true" isexp="true"> <td colspan="100" nowrap="nowrap"> <a href="javascript:" onclick="togglespgridviewgroup(this, false)" title="expand/collapse documenttype : agreement - contract"> <img src="/_layouts/images/minus.gif" border="0" alt="expand/collapse documenttype : agreement - contract"/> </a>  documenttype : agreement - contract </td> </tr>
in page, have jquery loops through "ms-gb" classed element, cannot seem dive appropriate elements find "documenttype : " in order perform .replace() empty text:
<script type="text/javascript"> $(document).ready(function () { $(".ms-gb").each(function () { var rownums = $(this).nextuntil(".ms-gb").length; $(this).children(0).append(" (" + rownums + ")"); $(this).html().replace("documenttype : ",""); //this horribly incorrect }); }); </script>
how can key text in order replace "documenttype : " text empty string?
you have set html
well:
var currenthtml = $(this).html(); currenthtml = currenthtml.replace("documenttype : ",""); $(this).html(currenthtml);
Comments
Post a Comment