I can't get the script to work that will replace old text with new text in specified th:
html content:
I would like to replace "Will Give Up" in second th with "Offered" and here's script I did that didn't worked:Code:<table align="center" cellspacing="1" class="homepagemodule report" id="trade_bait"> <caption> <span>Trade Bait</span> </caption> <tbody> <tr> <th class="franchisename">Franchise</th> <th class="willgiveup">Will Give Up</th> <th class="inexchangefor">In Exchange For</th> <th>Trade?</th> </tr>
Could use help to correct this or suggest different script that would work better.Code:function replaceText () { var offeredparent = document.getElementById('trade_bait').getElementsByTagName("tbody")[0].getElementsByTagName('tr').getElementsByTagName('th')[1]; var str = offeredparent.textNode.nodeValue; tr = str.replace('Will Give Up','Offered'); offeredparent.textNode.nodeValue = str; }
appreciate the help!
johnny


Reply With Quote
Bookmarks