Issue
How can I implement prepend and append with regular JavaScript without using jQuery?
Solution
Perhaps you're asking about the DOM methods appendChild and insertBefore.
parentNode.insertBefore(newChild, refChild)
Inserts the node
newChildas a child ofparentNodebefore the existing child noderefChild. (ReturnsnewChild.)If
refChildis null,newChildis added at the end of the list of children. Equivalently, and more readably, useparentNode.appendChild(newChild).
Answered By - Grumdrig Answer Checked By - Terry (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.