Skip to content

Challenge Disable an Element Using jQuery

SaintPeter edited this page · 1 revision
Clone this wiki locally

Disable an Element Using jQuery

You can also change the non-CSS properties of HTML elements with jQuery. For example, you can disable buttons.

When you disable a button, it will become grayed-out and can no longer be clicked.

jQuery has a function called .prop() that allows you to adjust the properties of elements.

Here's how you would disable all buttons: $('#button').prop('disabled', true);

Something went wrong with that request. Please try again.