Can anyone explain this exception in replace-child DOM “If the replacement of oldchild by newchild would lead to a cycle, that is if newchild is an ancestor of the node” with example?
            Asked
            
        
        
            Active
            
        
            Viewed 15 times
        
    0
            
            
         
    
    
        Brian Tompsett - 汤莱恩
        
- 5,753
- 72
- 57
- 129
 
    
    
        Behind The Web Page
        
- 103
- 6
- 
                    1There is no way that click and other events were working unless you looped over the collection and added the listeners to each instance or did something like `btn[0].addEventListener...` – charlietfl Dec 23 '21 at 11:47
- 
                    @charlietfl No bro i didn't did btn[0].addEventlistener but with btn.addEventlistener. It was working fine on other events but not on Mouse-Move. That is why i am also confused – Behind The Web Page Dec 23 '21 at 17:03
- 
                    1You must have been using getElementById() or querySelector() to return a single element only. Read the link at top of page thoroughly – charlietfl Dec 23 '21 at 17:06
- 
                    Yes thanks @charlietfl Issue got resolved after using (getElementbyId) – Behind The Web Page Dec 24 '21 at 08:42