--- id: bad87fee1348bd9aed808826 title: Disable an Element Using jQuery challengeType: 6 forumTopicId: 17563 dashedName: disable-an-element-using-jquery --- # --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: ```js $("button").prop("disabled", true); ``` Disable only the `target1` button. # --hints-- Your `target1` button should be disabled. ```js assert( $('#target1') && $('#target1').prop('disabled') && code.match(/["']disabled["'],( true|true)/g) ); ``` No other buttons should be disabled. ```js assert($('#target2') && !$('#target2').prop('disabled')); ``` You should only use jQuery to add these classes to the element. ```js assert(!code.match(/disabled[^<]*>/g)); ``` # --seed-- ## --seed-contents-- ```html

jQuery Playground

#left-well

#right-well

``` # --solutions-- ```html

jQuery Playground

#left-well

#right-well

```