Js or jq gets and overrides values under multiple elements

good master, have the following html structure

function picnewsTime() {
    var obj = $(".time");//JQclasstime

    for(var i = 0; i < obj.length ; iPP) {
        var txt = obj[i].textContent || obj[i].innerText;//
        //JQvar txt = $(this).text();

        var newhtml = replacePos(txt, 8, "<strong>");//replacePos()strong
        newhtml += "</strong>";//
        alert(newhtml);
    }
}
picnewsTime();

I failed when I tried to re-write the new newhtml value into span. I could only change all the dates to one value and searched for a few hours. I seemed to use a closure to get the correct result. Js rookie, I really couldn"t handle it. Please help me to see how to write it. Thank you!

maybe my ideas are all wrong, but there is a better way not to follow mine. It is best to omit the class= "time". The premise is that only js and jq can be modified at the front end, and the date passed in the background cannot be moved.

-add:-

I have made it possible for onclick to get the correct results, but how to change the following js to page load and execute it without the step of onclick

function picnewsTime() {
    var obj = $(".time");//JQclasstime
    for(var i = 0; i < obj.length; iPP) {
          (function(arg){     
            obj[arg].onclick = function() {
            var txt = obj[arg].textContent || obj[arg].innerText;//spantxtinnerTextietextContentffch
            //JQvar txt = $(this).text();
            var newhtml = replacePos(txt, 8, "<strong>");
            newhtml += "</strong>";
            alert(newhtml);
            $(this).html(newhtml);
            }
          })(i);//
    }
}
picnewsTime();
Sep.05,2021

const spans=document.querySelectorAll('-sharpnews>li>span');
    spans.forEach(function(item){
        item.innerHTML=item.innerHTML.replace(/(\d+)$/,'<strong>$1</strong>');
    });

the whole idea is wrong. The data taken to the background is processed as 2018-10 21 and then rendered to the page

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eaf3c3-48010.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eaf3c3-48010.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?