Learn to Code via Tutorials on Repl.it!

← Back to all posts
Making A Simple Front End API
AnthonyMouse

Making a Simple Front End API Tutorial

Great, thanks for coming to my tutorial! For once, this tutorial will not be for upvotes and cycles. :P
__
So first of all, you need to know about DOM in js. If not, check out a tutorial.
Let’s start. First, lets write a function to make elements.

Cool! But if we call our function (elt(‘h1’, ‘Hello’)) nothing happens. Thats because we didn’t append anything. Let’s write our second function:

Sweet. Now we can call our function to append something like this:

Hello world!

Nice! But let me explain everything.
The elt function makes a new element, and then assigns the innerText property to the text in the argument. The append function just appends it to the body. We’re done here! For a bit more extendable option, see my ECA (I’m horrible at names, right? Comment if you agree) down below.
|
|
\/

Voters
AnthonyMouse
Comments
hotnewtop
Karimo269

I am looking for it. Thank you for sharing
drift boss