I found a code in answer 9 of this thread that replaces text in an element. In my case the text is in an li
within a div class:
<div class="div-a">
<div class="div-b">
<ul class="list-unstyled">
<li>This is a foo list</li>
</ul>
</div>
</div>
$('.div-a .list-unstyled').html($('.div-a .list-unstyled').html().replace('foo','bar'));
I got it working in JSFiddle.
On the actual site there is an external page loaded with javascript (in which I need to replace one word). I put the code between <script></script>
tags after the script that loads the page, but I can't get it to work.
So my question is: where and how do I put this code on the actual page?