Ubiquity and consistency

  1. Use the HTML select element.
  2. Create your own dropdown widget using JavaScript (working with divs and spans).
  1. Identify core functionality.
  2. Make that functionality available using the simplest possible technology.
  3. Enhance!
  1. The user needs to select an item from a list of options.
  2. Use a select element.
  3. Use JavaScript to replace that native element with a widget of your own devising.
  1. The user needs to navigate to another page.
  2. Use an a element with an href attribute.
  3. Use JavaScript to intercept that click, add a nice transition, and pull in the content using Ajax.
  1. Start with user needs.
  2. Build an under-engineered solution — one that might not offer you much control, but that works for everyone.
  3. Layer on a more over-engineered solution — one that might not work for everyone, but that offers you more control.

--

--

--

A web developer and author living and working in Brighton, England. Everything I post on Medium is a copy — the originals are on my own website, adactio.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

5 simple changes that will make you a better JavaScript developer

Creating modules in JavaScript using Webpack and Babel — Part 1

How to Display Contacts using FlatList in React Native

How to set/update arrays inside objects in Firebase/Vue.js

Learning to Love Javascript by diving in to AJAX

Update Data in MongoDB using Node js

SelectorsHub 4.0 Live Now | The Best Xpath Plugin for Automation Testers

6 JavaScript Techniques To Help You Write Cleaner Code

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jeremy Keith

Jeremy Keith

A web developer and author living and working in Brighton, England. Everything I post on Medium is a copy — the originals are on my own website, adactio.com

More from Medium

Christopher Alexander on Pattern Language for Developers

My Recent Snafu with Xfinity Became a Template for a User Experience Nightmare

Image of the Xfinity logo

The best resources for learning web design

Make my dev branch a new main