O'Reilly logo

Mastering JavaScript High Performance by Chad R. Adams

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating new objects using the createElement function

Here, we will learn to create new objects using the createElement function along with the following three topics:

  • Working around the createElement function
  • Working with the createElement function
  • When to use the createElement function

Working around the createElement function

In JavaScript, we can create new page elements using the document.createElement() function and text objects to place inside our generated elements using the document.createTextNode() function. Typically, creating new elements to inject into our DOM can be a bit of a drain on rendering resources as well as interaction performance if done with multiple generated elements.

Working with the createElement function

Let's test how well ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required