How can i replace two characters in multiple elements? I have found an answer using jquery but I am searching for vanilla js.
I want to replace <
with <
and >
with >
.
I tried it by myself but it only replaced first of these symbols.
let string = data.val().message;
string = string.replace("<", "<").replace(">", ">");
// <div>1</div> result was <div>1</div>
it only replaced the first symbols.
The element with symbols to replace has a class of .msgContent
.