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>     &#160;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

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -