I have the following code:
var elements = document.getElementsByTagName('*');
for (var i = 0; i < elements.length; i++) {
var txt = elements[i].innerHTML.replace('Estoque1', 'Estoque Vencido');
}
It captures all page tags, and changes the word Inventory1 to Stock Expired. I need to make a code that it delete everything that is below the word "Stock Expired" after the word has been changed. In case, if it was in delphi I would use lastpos
, now in JavaScript I have no idea, can anyone help me?