0
<a href="/knowledgebase/category/community?language=tr" class="Category-Item">
<h4><span><i class="fas fa-comments"></i></span> Community</h4>
<p></p>
<span class="MoreArticles">8 Makaleler</span>
</a>

I want find and replace text under a class. For example; Finding "Community" text and change to "Topluluk". I writed a javascript language and i need do this for non-multilangual application.

Before: <a href="blabla" class="**Category-Item**"><i class="blabla">Community</i>

After: <a href="blabla" class="**Category-Item**"><i class="blabla">Topluluk</i>

Hasan Merkit
  • 115
  • 6

1 Answers1

0

from what i understood , you can select the element then change the inner text. if that's not what you ment please leave a comment.

let text = document.querySelector('h4');

text.innerText = "changed";
Steve Walson
  • 427
  • 2
  • 5