7. Where does the disabled class comes from


#1

How does the code know what to do with the disabled class.
I cant find it in the CSS or somewhere else.


#2

Hey Joris,

Good question!

The disabled class is a part of Bootstrap. Bootstrap is a CSS framework which makes creating websites easier, with prebuilt classes such as disabled :slight_smile:
Bootstrap also has a grid layout and a ton of other features, check out their website if you're interested in finding out more about it.


#3

I had guessed that the class was a bootstrap class re styling, it would make sense for them to have default disabled button styles. However adding the class is also preventing the .click() event handler from running. How does it do that? I was expecting that we would have to add an if statement in the handler. Does bootstrap prevent the click event somehow?


#4

stack-overflow to the rescue, looks like there is a way to make an element unclickable in css (pointer-events:none;) so Im guessing this is part of the bootstrap css (does bootstrap work via anything other than via css?)


#5

@bluerface

does bootstrap work via anything other than via css?

There's bootstrap.js for stuff like dropdown menus, but the Bootstrap that Codecademy uses here is CSS only, yes.