Tag: js tutorials

  • JavaScript Tutorial For Beginners #29 – THIS Keyword

    Hey all, in this JavaScript tutorial for beginners, I want to introduce you to the THIS keyword, so… Ninjas, meet the THIS keyword. THIS, meet the ninjas :). Anyway, THIS in JavaScript is a very useful tool, and refers to whatever object currently owns the context you are working in. For example, at the root…

  • JavaScript Tutorial For Beginners #40 – The onClick Event

    Hey ninjas / ninjarettes, in this JavaScript tutorial I want to run through a detailed example of how we can use the onclick event in JavaScript to create cool functionality on our websites. In this example I’ll use the onclick event to create a ‘show more’ style content box which expands and shrinks as you…

  • JavaScript Tutorial For Beginners 19 – Practical Example using Loops

    Hey gang, in this JavaScript tutorial I just wanted to show you a quick practical example of using loops to change elements on a HTML page. In this example, we’ll create an array of all the anchor tags on our HTML document, cycle through them using a for loop, and then add a dynamic class…

  • JavaScript Tutorial For Beginners #30 – Constructor Functions

    Hey ninjas, I think it’s about time we started using constructor functions to create our objects! So in this JavaScript tutorial for beginners I’ll introduce it to you! The constructor function is useful if you are creating many objects of the same ‘type’ – e.g. many different Car objects. It promotes DRY code (don’t repeat…