The problem of replacing labels in batch by JavaScript

problem description

Hi ladies and gentlemen:
now we have a problem. We need to batch process some tags under ID wzleftb. I hope the great god JS can take a look at it

replace all a tags with li tags

original html: to be processed

  <div class="wzleftb" id="wzleftb"> 
   <p style="text-align: center;">
       <a href="data/102129t32lrueuonnruum1.jpg" target="_blank"><img src="data/102129t32lrueuonnruum1.jpg" /></a>
       <a href="data/102129n8ir82wfvi9zd5c6.jpg" target="_blank"><img src="data/102129n8ir82wfvi9zd5c6.jpg" /></a>
       <a href="data/102129s29jk02wpt0wrew5.jpg" target="_blank"><img src="data/102129s29jk02wpt0wrew5.jpg" /></a>
   

</div>

processed html: (replace all a tags with li tags)

  <div class="wzleftb" id="wzleftb"> 
       <li><img src="data/102129t32lrueuonnruum1.jpg" /></li>
       <li><img src="data/102129n8ir82wfvi9zd5c6.jpg" /></li>
       <li><img src="data/102129s29jk02wpt0wrew5.jpg" /></li>
  </div>

Gods, I haven"t done my research for a long time, so I asked for help.

Apr.05,2021

     var html="";
      $.each($("img"),function(index,value){
          html+="<li><img src="+$(this).attr("src")+"/></li>";
      })
      $("div").html(null);
      $("div").append(html);

var wzleftb = document.querySelector('-sharpwzleftb'),
  imgList = wzleftb.querySelectorAll('img'),
  dom = document.createDocumentFragment(); // 

for (var i = 0, len = imgList.length; i < len; iPP) {
  var li = document.createElement('li');
  li.appendChild(imgList[i]);
  dom.appendChild(li); // 
}
wzleftb.innerHTML = ''; // 
wzleftb.appendchild(dom); // 

var tag = '';
$('-sharpwzleftb a').each(function(i,item){
    $(item).find('img').wrap('<li></li>');
    tag += $(item).html();
    $('-sharpwzleftb').html(tag)
})
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-1b3e3a0-2c405.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-1b3e3a0-2c405.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?