Skip to content

Instantly share code, notes, and snippets.

@0mg
Created March 18, 2012 11:34
Show Gist options
  • Save 0mg/2070728 to your computer and use it in GitHub Desktop.
Save 0mg/2070728 to your computer and use it in GitHub Desktop.
removeChild vs innerHTML

removeChild vs innerHTML

ノードを除去するのに removeChild() と innerHTML = "" とではどちらが速い?

方法

rmnode.html

結果

removeChildinnerHTMLratio
Chrome 16.06ms3ms2.00 : 1
Safari 5.18ms4ms2.00 : 1
Opera 11.6118ms6ms3.00 : 1
Firefox 11.075ms44ms1.70 : 1
MSIE 8.0453ms2906ms1 : 6.41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment