innerHTML = "" vs while removeChild

Edit on GitHub

Setup

Tests

  • innerHTML = ""

    var ul = document.createElement('ul');
    
    ul.innerHTML = "";
  • while removeChild

    var ul = document.createElement('ul');
    while(ul.firstChild){
    ul.removeChild(ul.firstChild);
    }