.prop()
的函数,允许您调整元素的属性。以下是禁用所有按钮的方法: $("button").prop("disabled", true);
仅禁用target1
按钮。 target1
按钮。
testString: 'assert($("#target1") && $("#target1").prop("disabled") && code.match(/[""]disabled[""],( true|true)/g), "Disable your target1
button.");'
- text: 不要禁用任何其他按钮。
testString: 'assert($("#target2") && !$("#target2").prop("disabled"), "Do not disable any other buttons.");'
- text: 只使用jQuery将这些类添加到元素中。
testString: 'assert(!code.match(/disabled[^<]*>/g), "Only use jQuery to add these classes to the element.");'
```