Last active
          December 23, 2015 03:59 
        
      - 
      
- 
        Save smallnewer/6576720 to your computer and use it in GitHub Desktop. 
    当对div.innerHTML赋值为某些不符合嵌套规范的标签时,会出现标签丢失的现象。
在做domParse时会出问题。此为问题重现。
解决办法:https://gist.github.com/smallnewer/6577784
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | var domParser = document.createElement("div"); | |
| var html = "<td>123</td>"; | |
| // 设置 | |
| domParser.innerHTML = html; | |
| //打印 | |
| console.log(domParser.innerHTML); // "123",td标签丢失了。 | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment