<!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>

News Reporter
IT Software and web development, Core PHP, JavaScript, JQuery, HTML, CSS, CakePHP, Angularjs, Codeigniter etc.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

code