You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If my updated element is not the last child, it is pushed to the last due to appendChild. Although we delete the updated element's dom from the parent dom, we are still appending the updated element's dom to the end.
Eg <div id="parent"> <h2 title="child">Chapter 4 (Reconciliation)</h2> {update ? <span id="span1">span1</span> : <div id="div1">div1</div>} <div id="div2">div2</div> <div>
In the above case, the span gets appended as the last child of the parent div instead of being the 2nd child when the update becomes true. Should we be using "repalceChild" instead?
The text was updated successfully, but these errors were encountered:
If my updated element is not the last child, it is pushed to the last due to appendChild. Although we delete the updated element's dom from the parent dom, we are still appending the updated element's dom to the end.
Eg
<div id="parent"> <h2 title="child">Chapter 4 (Reconciliation)</h2> {update ? <span id="span1">span1</span> : <div id="div1">div1</div>} <div id="div2">div2</div> <div>
In the above case, the span gets appended as the last child of the parent div instead of being the 2nd child when the update becomes true. Should we be using "repalceChild" instead?
The text was updated successfully, but these errors were encountered: