I have an element like below;
<p> I am lost </p>`
I need to highlight "am" like below;
<p> I <mark style="background-color:#FFFF00;">am</mark> lost </p>
My code is like this.
String newText = "I <mark style=\"background-color:#FFFF00;\">am</mark> lost";
element.text(newText);
But when I print the element it looks like this.
<p>I <mark style="background-color:#FF0000;">am</mark> lost</p>
Are there any ways to force "<" and ">" characters to elements using Jsoup?