Hi, i need help to create a recursive function to read all list structure

Hi, i need help to create a recursive function to read all list structure

Hi, i need help to create a recursive function to read all list structure.

I need "alert()" the content inside of each "<li>" start from the first <ul> until the last one. 

Bellow follows an example of list to works.... important... the function must be unchangeble.,, but must result the result accordly i change the list...

  1. <ul>
  2.     <li>A</li>
  3.     <li>B</li>
  4.     <li>C</li>
  5.     <li>D 
  6.         <ul>
  7.             <li>A.1</li>
  8.             <li>A.2</li>
  9.             <li>A.3
  10.                 <ul>
  11.                     <li>A.3.1</li>
  12.                     <li>A.3.2</li>
  13.                     <li>A.3.3</li>
  14.                 </ul>
  15.             </li>
  16.             <li>A.4</li>
  17.             <li>A.5</li>
  18.         </ul>
  19.     </li>
  20.     <li>E</li>
  21.     <li>F</li>
  22. </ul>


  23. Anybody can help me?

  24. thanks!