O'Reilly logo

Pro HTML5 Performance by Mike Jones, Jay Bryant

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

C H A P T E R  13

images

Button Control

Here’s another seemingly simple piece of HTML to make into a control. However, while it may seem like an odd place to invest effort, doing so pays off in consistency, flexibility, and developer velocity. We’ll stick with the fractal design pattern. That is, we’ll use (reuse, really) the same HTML for each kind of button, use Boolean values on the server side to identify which kind of button to display, and create the presentation variations by dynamically setting a CSS class.

images Note We often call each variation ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required