As in the whole html document to replace the text?

There are three places of exile:

<a href="https://toster.ru/?LMI=100"></a>

<a href="https://toster.ru/?LMI=100"></a>

<a href="https://toster.ru/?LMI=100"></a>


Need JS to replace 100 of 300 in three links.

I tried this:
$("a").each(function() {
 var text = $(this).text();
 text = text.replace("LMI=100.00", "LMI=300.00");
$(this).text(text);
});


IMPORTANT! You can't replace the whole link, it is necessary to replace a global variable LMI!
June 3rd 19 at 19:24
1 answer
June 3rd 19 at 19:26
$("a").each(function(){
 var $this = $(this);
 $this.attr('href', $this.attr('href').replace("LMI=100", "LMI=300"));
});
alas, not working :( - brenna53 commented on June 3rd 19 at 19:29
, https://codepen.io/UnluckySerivelha/pen/oMBWgW - augustus.Mayer commented on June 3rd 19 at 19:32

Find more questions by tags JavaScriptHTML