get it on google playCreated with Sketch.
JavaScript> Creating an element

Creating an element

To create an element, we use document.createElement().


<body>
 <h2>New Messages</h2>
 <script>
 var paragraph = document.createElement();
 </script>
</body>

Create a specific element by coding its name surrounded by quotes. For example, code "p" to create a paragraph.

 <body>
  <h2>New Messages</h2>
  <script>
   var paragraph = document.createElement("p");
  </script>
 </body>
TRY IT ON THE APP