List

Build the below question in Javascript with following rules-

  • Make a html page with a UL element with 3 list items with text - A, B, C.

  • Clicking on any li element should add child list to it with proper naming.

Clicking on B

<ul>
  <li>A</li>
  <li>B</li>
  <li>C</li>
</ul>

will change the html to

<ul>
  <li>A</li>
  <li>
      B
      <ul>
          <li>B1</li>
      </ul>
  </li>
  <li>C</li>
</ul>

Clicking on B1 will change it to

<ul>
  <li>A</li>
  <li>
      B
      <ul>
          <li>
              B1
              <ul>    
                  <li>B11</li>
              </ul>
          </li>
      </ul>
  </li>
  <li>C</li>
</ul>

You can use any javascript plugin you are familiar with.

Please send your solution to [email protected]

Working Video



What do we do?


We work on website development using Ruby on Rails, NodeJS, ReactJS, AngularJS. View all the services we provide here.


Say Hello! See our work