What is the effect of parent.insertBefore(child,child) — in other words, of trying to insert a node before itself?
The child node should be removed from its parent, then reinserted in the same place, as if the call had actually been parent.insertBefore(child,child.getNextSibling()). Note that this is not considered a usage error; no DOMexception is thrown. Nor is it necessarily a “no-op” even though the document is left unchanged, since the removal and reinsertion may have side effects — for example, MutationEvents may be fired, and NodeIterator and Range fixups may occur.
Related Questions
- My child gets a 100 every week on the spelling tests. Should my child receive more difficult words on the spelling list?
- My child has a good visual memory and seems to be memorizing words. Is READ designed to encourage memorization?
- What is the effect of parent.insertBefore(child,child) -- in other words, of trying to insert a node before itself?