Home Forums General XMetaL Discussion What is selected Reply To: What is selected

andygasser

Reply to: What is selected

It seems that it's not that simple. Selection.ContainerNode does not give you the current node, as the documentation states, it gives you the selection's container.

Consider this example:
[code]

      Child 1
    Child 2
    Child 3
 

[/code]

When the user has the second Child element (child 2) selected how can I figure that out. When I use Selection.ContainerNode it returns the Parent element. Using DOM from there will allow me to navigate to the Child nodes but how do I know which one is selected.

I agree I can change the selection using the Selection API but how will it help me figure out which Child element is selected.

Reply

Products
Downloads
Support