Replace li end text using jquery :    
I am trying to replace the content of li and <a> tags.

Tried below code.
   
        <html>
       <head>Sample</head>
       <body>
       <a href="#">
            <input type="checkbox" class="layer-input-filter" 
    name="testname">Test <span class="count">5</span>
      </a>
 
        <a href="#">
             <input type="checkbox" class="layer-input-filter" 
     name="testname1">Test1 <span class="count">10</span>
    </a>
 
     <ul>
	    <li><a href="#" rel="noopener">Mixed assessment guidelines</a> 
       </li>
	  <li><a href="" target="_blank" rel="noopener">Specimen </a></li>
	  <li><a href="#" rel="noopener">Plagiarism </a></li>
	  <li><a href="" target="_blank" rel="noopener">Download </a></li>
	  <li><a href="#" rel="noopener">Qualification update</a></li>
	  <li><a href="" target="_blank" rel="noopener">Specimen</a></li>
	  <li><a href="#" rel="noopener">Exam guide update</a></li>
	  <li><a href="" target="_blank" rel="noopener">Guide </a></li>
     </ul>

      <script>
         $(document).ready(function($) {
          $("body").find('li').each(function (index) {
					//checks that the text isnt empty, no need to store that.
					if ($(this).text() != '') {
						var str = $(this).text();
						var str1 = $(this).clone().children().remove().end().text();
						//console.log("li text",str1);
						var newstring =  str + str.substring(0, str.length  * value);
						console.log(newstring);
						//$(this).html($(this).html().replace(str,newstring));
						$(this).text(newstring);
					}
				});
        });
       </script>
     </body>

      </html>

I need to replace the text of every li inside the body. so used above jquery for it. But its not working.

Can anyone help me with this please, Thanks

      