简体   繁体   中英

how to remove/change/replace text after input field using jquery

<td width="100" align="center" id="5-0" class="c5 r0">
  <input type="hidden" value="3">Service Tax
  <span class="jexcel_arrow">
    <span id="jexcel_arrow"></span>
  </span>
</td>

How do i change 'Service Tax' string from jquery. 'Service Tax' string might get change in future so string can be anything which i want to replace.

Please note: We can't change the HTML structure.

Thank you all for your guidelines.

Link( Changing text after an input field ) shared in comment helped me. It's slightly different but resolved my problem. Below is the code to resolve it.

var inputTaxCol = $("#" + newtaxColId + " :input");
                  text = inputTaxCol[0].nextSibling.nodeValue,
                  newText = text.replace(text, 'my new text here');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM