THE PENDING DRAFT

When you want a click to change something on your page, you usually reach for Javascript. Adhering to principles of modularity and separating structure, presentation, and behavior we’re supposed to use Javascript for behavior layer. However, methods exist for generating click events using only html and css. What are they and should we use them?

An interesting article about using CSS Click events instead of JavaScript. Steven Bradley walks through different ways of adding CSS click events, from pseudo-selectors like :target/:active to other more “hacky” things you can do with checkboxes or radio input fields. Personally i think the best way to add click events remains Javascript, but CSS is certainly moving more and more in a direction where we can use stuff like this without any hacks. And that is a good thing.

How To Generate CSS Click Events And Thoughts About Whether You Should – Vanseo Design.

Leave your comment