Home > front end >  Document. The getElementById (" table "). The use of the innerHTML
Document. The getElementById (" table "). The use of the innerHTML

Time:04-02

InnerHtml data can be removed to take out the inside of the data?

CodePudding user response:

Can consider to copy a virtual dom elements, the virtual operation dom element data before taking innerHTML.

CodePudding user response:

reference 1/f, night without Chen reply:
can consider to copy a virtual dom elements, the operating data of virtual dom elements and then take innerHTML can

There are instances consult?

CodePudding user response:

 
Var table=document. The createElement method (" table ");
Table. The innerHTML='& lt; Tbody> 123 & lt;/td> ';
The console. The log (table. InnerHTML);
Table. The getElementsByTagName (' tbody) [0]. Remove ();
The console. The log (table. InnerHTML);
  • Related