0

Hello
I would be grateful if someone could help me achieve a parent-child relationship as shown in the attachment, using the <a href> tags

Attachments Inbox_-_IncrediMail_2.png 24.5 KB
3
Contributors
3
Replies
5
Views
6 Years
Discussion Span
Last Post by Ritesh_4
1

Generally, just put them in nested ul 's:

<ul>
  <li><a>Something</a></li>
  <li>
    <ul>
      <li><a>Something else..</a></li>
      <li>
        <ul>
          ...
        </ul>
      </li>
    </ul>
  </li>
</ul>

By the way, this is HTML, not javascript.

Edited by twiss: n/a

0

You could make an object in JavaScript for each node you need and define whether it's an absolute parent (has no ancestors), a parent and a child, or an absolute chile (has no descendents). Then have a method that sets an array to define the arrays in parents, and when you instantiate it, give it a reference to the instantiation's DOM selector.

After you do that, set up a script in jQuery (what I would do at least) that goes and decides what type of node everything is and calls the methods that instantiate the objects based on where they are your ancestral order.

0

thanks twiss ans TySkby, but twiss' method is more appropriate as I have no jscript on the page, and need a simple parent-child view on the page

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.