The answer is no, there isn't an internal id you can access. Opera and IE (maybe Safari?) support .sourceIndex
(which changes if DOM does) but Firefox has nothing of this sort.
You can simulate source-index by generating Xpath to a given node or finding the index of the node from document.getElementsByTagName('*')
which will always return elements in source order.
All of this requires a completely static file of course. Changes to DOM will break the lookup.
What I don't understand is how you can loose references to nodes but not to (theoretical) internal id's? Either closures and assignments work or they don't. Or am I missing something?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…