Events in JavaScript – Part 1 – Coding a “Score Keeper Game”

We use JavaScript to control the behaviour of a web page. We do this by adding events to our page. Examples would be to “listen” for a click or for when the mouse hovers over an image or when the user hits a key on their keyboard etc. The process of events is that we assign an event and then “listen” for a desired response from the user. To add an event listener we use the addEventListen method which is...Read more

4 Areas of DOM Manipulation in JavaScript

In my last post, I wrote about the 5 different Document Object methods and in this post I’m going to expand on that and talk about Document Object Manipulation in JavaScript. If HTML is the page structure and CSS is the page styling then JavaScript is there to control the page behaviour. The 4 main areas of DOM manipulation are: Style manipulation Class manipulation Tag manipulation Attribute manipulation Editing an elements style with the “Style” property When we talk about...Read more

5 Document Object Methods in JavaScript (a small DOM cheat sheet)

Document is an object in JavaScript that refers to the entire contents of a web page and this post is going to talk about each of the methods inside this document object. The 5 “Document” Methods are as follows: This area of JavaScript is referred to as “DOM” or Document Object Manipulation and is how we get our JavaScript to interact with or “manipulate” the HTML and CSS in the browser. This is the example HTML code we’re going to...Read more

Getting started with JaveScript and a real basic program

I’m currently following an online course on udemy.com which is teaching me JavaScript. I’ve decided to make some notes along the way to refer back to once all this stuff gets pushed out of my head again when I get back into robotics in September. This post is about how to start up a new JavaScript project using Sublime text editor (3). The first thing to do would be to create a new project folder somewhere on your computer and...Read more
Understanding HTML forms

Understanding HTML forms

For years I’ve constantly found myself struggling (as I come back to it again and again) with HTML forms. Not necessarily because I don’t understand how they work, but more because I’m not exposed to them that often. However, that said, I’ve now got to start building a system that has some forms in it and I’m therefore revisiting my notes to freshen up on the topic. I decided to write a blog post as my own personal “cheat sheet”...Read more