--- id: bad87fee1348bd9aed808826 title: Disable an Element Using jQuery challengeType: 6 forumTopicId: 17563 --- ## Description
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); Disable only the target1 button.
## Instructions
## Tests
```yml tests: - text: Your target1 button should be disabled. testString: assert($("#target1") && $("#target1").prop("disabled") && code.match(/["']disabled["'],( true|true)/g)); - text: No other buttons should be disabled. testString: assert($("#target2") && !$("#target2").prop("disabled")); - text: You should only use jQuery to add these classes to the element. testString: assert(!code.match(/disabled[^<]*>/g)); ```
## Challenge Seed
```html

jQuery Playground

#left-well

#right-well

```
## Solution
```html

jQuery Playground

#left-well

#right-well

```