Read UL and Li By using JQuery and Javascript

On

<!DOCTYPE html><html><head>   <title></title></head><body>  <ul class=”ul-test”>    <li>a</li>    <li>b</li>    <li>c</li>    <li>d</li>  </ul></body></html> JQuery and JavaScript Script <script type=”text/javascript”>//By using JQuery$(document).ready(function(){  $(“.ul-test”).each(function(){     $(this).text();  });}); //By using Javascript- var ulObj = document.getElementsByClassName(“ul-test”)[0].children;for(let i=0; i<ulObj.length;i++){     console.log(ulObj[i]);    document.write(ulObj[i].innerText);}</script>