I want to change text color on hover for text in a repeater without changing the text size or font style. I also still want the repeater to pull from the database for this text box. Below is my code. I know that “Your Text in Hed1” is inaccurate because it changes what the text placeholder is, and also, doesn’t pull info from the database. What else am I doing wrong?
$w.onReady(function () {
$w(‘#Hed1’).onMouseIn(()=>{hoverTxt();});
$w(‘#Hed1’).onMouseOut(()=>{unhoverText();});
});
function hoverTxt(){
let oldHtmlStr = $w(‘#Hed1’).html;
let newHtmlStr = $w(‘#Hed1’).html = “
Your Text in Hed1
”;console.log(newHtmlStr);
$w(‘#Hed1’).html = newHtmlStr;
}
function unhoverText(){
let oldHtmlStr = $w(‘#Hed1’).html;
let newHtmlStr = oldHtmlStr.replace(/ #F60419 /i, ’ #000000 ‘);
console.log(newHtmlStr);
$w(’#Hed1’).html = newHtmlStr;
}