Executing [removed] elements inserted with [removed]

后端 未结 20 2823
囚心锁ツ
囚心锁ツ 2020-11-22 00:12

I\'ve got a script that inserts some content into an element using innerHTML.

The content could for example be:



        
20条回答
  •  [愿得一人]
    2020-11-22 00:55

    You should not use the innerHTML property but rather the appendChild method of the Node: a node in a document tree [HTML DOM]. This way you are able to later call your injected code.

    Make sure that you understand that node.innerHTML is not the same as node.appendChild. You might want to spend some time on the Javascript Client Reference for more details and the DOM. Hope the following helps...

    Sample injection works:

    
    
    
        test
        
    
    
        
        

    regards

提交回复
热议问题