JavaScript USES append to add an element to report an error

  • 2020-03-30 03:27:55
  • OfStack

1. Error description

On Internet explorer:

Uncaught HierarchyRequestError: Failed to excute 'The appendChild' on 'Node' : The new child element contains The parent.

On Google browser:

SCRIPT5022: DOM Exception: HIERARCHY_REQUEST_ERR (3) the error

2. Wrong reasons

Append () contains append() in append()

Such as:


append(append("String"));

3. Solutions

Remove append from append and put the string inside append into the outside append


Related articles: