• Sunday , 24 September 2017

JavaScript Tutorial For Beginners #37 – Adding Elements to the DOM

Code Canyon



Hey all! So for I’ve taught you how to change existing content in the DOM, but in this JavaScript tutorial I want to show you how to add new elements too!

To do this we use the createElement method, and then insert the new element into the DOM by using either one of the following methods:

appendChild(child)
insertBefore(child, element)

If you have any questions, fire away 🙂

SUBSCRIBE TO CHANNEL – https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg?sub_confirmation=1

========== JavaScript for Beginners Playlist ==========

========== CSS for Beginners Playlist ==========

========== HTML for Beginners Playlist ==========

========== The Net Ninja ============

For more front-end development tutorials & to black-belt your coding skills, head over to – https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg or http://thenetninja.co.uk

========== Social Links ==========

Twitter – @TheNetNinja – https://twitter.com/thenetninjauk

Original source

3d Ocean

Related Posts

9 Comments

  1. _TomExtreme _
    July 14, 2017 at 18:12

    I really liked this tutorials and ive learned so much with them! But I have a doubt… Why would I do this in JS if I could just go to HTML or CSS and edit it there? Can someone help please?

  2. Thania Abrahams
    July 14, 2017 at 18:12

    Thanks so much for this video series! Quick question – why does it remove the link at the bottom and create it at the top? Surely it shuld have one at the bottom and the top? Why is the first rule being overridden?

  3. Igor Luzhnyi
    July 14, 2017 at 18:12

    Great videos, I've learnt so mush from your tuts! I have a question: what if I have to add two identical elements(for example, <p>) in different places? Thanks in advance!

  4. The5starSTUNNNA
    July 14, 2017 at 18:12

    Can you make a React Native tuts

  5. DR3WEBDEV
    July 14, 2017 at 18:12

    I really really really appreciate the videos. Did I say I appreciate the videos. You made every thing understandable I've watched hundreds of hours of videos on JavaScript. When I found your page last night, I knew I was on my way to fully somewhat understanding JavaScript. Thanks again. #codeForLife.

  6. landwarrior82
    July 14, 2017 at 18:12

    Genius Irish kid right there my friends 🙂

  7. For Phone
    July 14, 2017 at 18:12

    GREAT TUTORIAL, i can clearly see that you understand those things so well…… the way you talk is so clear, becuase your ideas are so clear!!!
    thanks

  8. Liad Paryente
    July 14, 2017 at 18:12

    Your tutorials are great, and much appreciated 🙂

  9. Yoxxai
    July 14, 2017 at 18:12

    Great tutorial. But why would i do this if i can just write it in HTML?

Leave A Comment

You must be logged in to post a comment.