Tagged: JavaScript

Event Delegation with jQuery

It surprises me how many developers are unaware of – or ignorant of – event delegation within JavaScript and jQuery events. Sometimes when developing a site or application we need to attach an event handler to multiple elements, and those elements may or may not be in the DOM when it’s initially loaded (AJAX loaded content […]


grunt-sass vs grunt-contrib-sass

If you use grunt-contrib-sass to compile your SCSS code into CSS I recommend taking a look at grunt-sass. It can be used as an drop in replacement for grunt-contrib-sass but with one major difference: speed. grunt-contrib-sassuses a Sass compiler written in Ruby. It works just fine for projects where you don’t have a lot of […]


Using the HTML5 required Attribute for Multiple Elements

While developing an eCommerce site I was asked by the client if it was possible to add the HTML5 required attribute to the telephone number and mobile number fields. Only one field would actually be required so if a customer entered a telephone number the browser wouldn’t throw an error about the mobile number field […]