[MUSIC]
>> What is a div button?
Question 2 is why is a div button a challenge?
>> You could have ended
the second question at why is a div button?
>> Why is div button?
Then why is a div button?
I feel like we're getting existential here.
>> It's every day of my life.
It's why is a div button,
why is it [inaudible] ? Why are tooltips?
Yes. A div button is a button.
When you say button to a lot of
web developers, they picture something.
Like it's an image in their head,
and usually it's, I don't know,
the thing with the background and
rounded corners with a text on it or an icon or something.
Like there's certain visual conventions
that tell people who can see that they
should click on a thing
and make it a little different from a link.
A link has its own visual conventions.
When a lot of people think button,
they think the visuals of button,
but the thing is like a button does
a lot more besides the visuals,
and the button element encapsulates all of that.
You can style it. It has outdated button visuals,
but you can style it to have current button visuals and it
does everything else that a button is expected to do.
It activates with a keyboard with Enter and Space.
It's focusable.
It gets certain color affordances
and high-contrast mode, things like that.
There's all of these affordance.
I use the word affordance.
But all of these behaviors
and things built into a button that go beyond
the pure visuals in normal color mode or default color mode.
A div button is recreating only the behavior with a mouse,
and default color mode appearance
using a div with an on-click handler usually.
>> Interesting, okay.
>> So it looks like a button and you can click
it with a mouse or with a touchscreen.
But otherwise it doesn't work with keyboard,
it doesn't look like a button in high-contrast mode,
it's not focusable, all this other stuff.
>> Okay. Basically, it's taking
what was perfectly fine and usable,
throwing that out and deciding,
hey, let's build something from scratch,
and that thing that we've now built doesn't
have all of that usability then that you just highlighted.
>> Yeah.
>> Okay.
>> For the wires, the temperate question,
I think it's because a lot of
beginning web tutorials make buttons out of divs,
and I think there's this mistaken,
in my opinion notion,
that divs are easier to style than buttons.
Buttons to me are pretty easy to style.
I mean, if you can style anything,
I feel like you can style a button element.
>> Yeah. No, no, no.
One of the things I always like to make
clear is that everything that
Sarah is saying and everything that
me as Christopher that I'm saying,
this is always our own opinions,
which is also that in turn, my way of saying, "Hey,
feel free to have opinions here.
That's perfectly acceptable."
>> I don't mean to be like,
oh, CSS, is easier.
But in as much as CSS is easier or difficult,
I feel like styling a button is pretty unexceptional?
>> Yeah. If you can style a div tag, like you said,
you could probably style a button as well,
a lot of those same things.
Those same things apply.