Tagged: jQuery

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


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