2
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 Stock to Expired Stock. I need to make a code that it erase anything below the word "Stock Past", after changing the word. In Case, if it were in Danish I would use the lastpos
, now in Javascript I have no idea, someone can help me ?
in this case that you posted, it changes all the words Stock 1 that exist on the page, I need different. After he finds the word Stock 1, he switches it for Expired Stock, and whatever is AFTER the word expired stock he erases everything from the page, understood ?
– user7605
But this is what he does, only relative to the element in which the word is found. Or you want it to delete all other elements in the DOM below the word "Stock1"?
– Kazzkiq
I want it to all elements, below the word Stock 1, all.... that you have in html.
– user7605