Archive for the ‘Raw Javascript’ Category

JavaScript Design Patterns: The Observer Pattern

Posted on: No Comments
In JavaScript, there is a problem that comes up often. You need a way to update parts of a page in response to certain events, with the data these provide. Say, for example, user input that you then project into one or many components. This leads into ...

Instant Form Validation Using JavaScript

Posted on: No Comments
HTML5 introduces a couple of new attributes for implementing browser-based form validation. The pattern attribute is a regular-expression that defines the range of valid inputs for textarea elements and most types of input. The required attribute speci...

6 jQuery-inspired Native DOM Manipulation Methods You Should Know

Posted on: No Comments
When jQuery was released, one of the main reasons behind its meteoric rise to popularity was the ease with which it could select DOM elements, traverse them and modify their content. But that was way back in 2006. In those days we were stuck with Inter...

The MVC Design Pattern in Vanilla JavaScript

Posted on: No Comments
Design patterns often get incorporated into popular frameworks. The Model-View-Controller (MVC) design pattern, for example, is one that is ubiquitous. In JavaScript, it is hard to decouple the framework from the design pattern. Oftentimes, a particula...

Back to Basics: What are Callbacks in JavaScript?

Posted on: No Comments
When learning JavaScript, it doesn't take long until you encounter callbacks. These might seem strange and mysterious to beginners, yet it is very important to understand how they work in order to harness the power of the language. In this article I wi...

What Is Event Bubbling in JavaScript? Event Propagation Explained

Posted on: No Comments
Event bubbling is a term you might have come across on your JavaScript travels. It relates to the order in which event handlers are called when one element is nested inside a second element, and both elements have registered a listener for the same eve...

How to Make a Simple JavaScript Quiz

Posted on: No Comments
"How do I make a JavaScript quiz?" — this is one of the most common questions I hear from people who are learning web development, and for good reason. Quizzes are fun! They are a great way of learning about new subjects and allow you to engage your ...

Learning JavaScript Test-Driven Development by Example

Posted on: No Comments
You're probably already familiar with automated testing and its benefits. Having a set of tests for your application allows you to make changes to your code with confidence, knowing that the tests have your back should you break anything. It's possible...

Back to Basics: JavaScript Operators, Conditionals & Functions

Posted on: No Comments
Table of Contents JavaScript Operators Assignment Operators Arithmetic Operators Addition Subtraction Multiplication Division Modulus Increment Decrement Comparison Operators Equal Strict Equal Not Equal Strict Not Equal Less Than Less Than or Equal To...