whenever i add this function to underline a specific word("boy") my word processor write from right to left why?
const contentDiv = document.getElementById("content");
contentDiv.addEventListener("input", () => {
const text = contentDiv.textContent;
const formattedText = text.replace(/\bboy\b/g, 'boy');
contentDiv.innerHTML = formattedText;
});
<div id="content" contenteditable="true" spellcheck="false"></div>