tezvyn:

How does affordance guide choosing a native button over a styled div?

Source: developer.mozilla.orgintermediate

This tests if you see affordance as built-in behavior, not only looks. A strong answer picks the native button for free keyboard, focus, and reader support, noting a div needs tabindex, role, and keydown logic. A red flag is treating it as purely visual.

This tests whether you understand affordance as built-in interaction capability rather than mere visual styling, and if you can weigh the engineering cost of replicating native semantics. A strong answer advocates for the native button because it provides free keyboard handling, automatic focus management, and correct reader announcements without extra scripts, whereas a styled div requires manual tabindex, role, keydown listeners for Enter and Space, and extra maintenance.

Read the original → developer.mozilla.org

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

How does affordance guide choosing a native button over a styled div? · Tezvyn