2

I wasn't sure how to phrase this so the title is a bit cryptic.

I feel that elements such as <a>/<button>/etc were created for user interaction while others such as <div>/<li>/etc were created more for structure/organization. Is it bad practice to create user interaction via JS on an <li> element rather than using a button or link within the <li>?

I feel like it is bad practice, but I don't have a backing for my argument.

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
Benjamin
  • 1,206
  • 1
  • 12
  • 23

1 Answers1

2

The sole reason you may want to prefer 'interactive' elements over non-interactive ones is if you plan for fallback. If you view your site on a Javascript-disabled client, links and buttons will still be clickable, and this lets you provide some fallback. <li> tags, and other "non-interactive" elements, will be as inanimate as can be, though.

If this is not a concern, or there is no way anyways that your application can survive without Javascript, then you have no reason to worry.

zneak
  • 134,922
  • 42
  • 253
  • 328
  • I know that they aren't worried about users without JS. Just wasn't sure if there was any specification/etc I was missing. Thanks! – Benjamin Mar 27 '12 at 01:42