I agree that your output is more desirable. I suspect that there is some version difference accounting for what we are seeing. I used your code and got the same error that the OP reported, even though, like you, I know his error was caused by using $doc instead of $ele. That is why I suggested that the OP try both your code and mine.
In reply to Re^4: NOT_FOUND_ERR in insertAfter()
by Anonymous Monk
in thread NOT_FOUND_ERR in insertAfter()
by kingsaint
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |