运行 ❯
获取您自己的
网站
×
更改方向
保存代码
更改主题,暗/亮
前往Spaces
<!DOCTYPE html> <html> <body> <h2>JavaScript Performance</h2> <p>If you expect to access a DOM element several times, access it once, and the use it as a local variable:</p> <p id="demo"></p> <script> const obj = document.getElementById("demo"); obj.innerHTML = " Hello"; </script> </body> </html>