Change SPAN Value using JS

Hi There

I am trying to change the SPAN value which shown below “2020/12/1” to “2020/12/31”

2020/12/21

Although I tried following scripts, both of them returned “Undifined”…


function test() {
document.getElementById(“HOGEHOGE”).innerHTML = “2020/12/1”;
}


function test() {

document.querySelector(“span[title=‘HOGEHOGE’]”).id = “test”;
document.getElementById(“test”).innerHTML = “2020/12/1”;
}

Your help would be much appreciated