Home › Forums › General XMetaL Discussion › What is selected › Reply To: What is selected
Reply to: What is selected
May 6, 2009 at 1:32 pmIt 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]
[/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.