@hello67029 I’m not sure what exactly you’re trying to do, but let say you want to replace every “carbon” by “oxygen” and highlight it.
then:
let newWord = "oxygen";
$w("#text1").html = $w("#text1").html.replace(/carbon/gi, `<mark>${newWord}</mark>`);