List | Inkoop

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 hiring@inkoop.in with Subject "Hiring for JS developer".

Working Video

Have a Project in mind?