-
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…