Maison  >  Questions et réponses  >  le corps du texte

javascript - 如何比较querySelectorAll和getElementById的性能?

我想知道用什么方法去测试?

有人踩,为什么不给个理由。

PHP中文网PHP中文网2748 Il y a quelques jours567

répondre à tous(1)je répondrai

  • 黄舟

    黄舟2017-04-10 12:47:46

    var t=new Date(); for(){querySelectorAll()}500次 var r=new Date(); alert(t-r);

    for(){getElementById()}500次

    répondre
    0
  • Annulerrépondre