How to write an element just after another with javascript? [duplicate]

The accepted answer will work in this specific case, but to insert an element after another more generally, the following does the job:

someElement.parentNode.insertBefore(newElement, someElement.nextSibling);

Where newElement is the element to be inserted and someElement is the element it is to be inserted after.

W3C insertBefore method of the Node interface

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)