There are two lists and a button. How to write the conditions correctly, that if the second list has a disabled property, then the button also needs to be assigned disabled ?

How to assign a button attribute, figured out. This is true:

 $('#btn').attr('disabled', true); 

And how to get the property and check the list?

  • Your question is not enough data to answer. - Visman Sep.

2 answers 2

Get attribute value

 var is_disabled = $('#btn').attr('disabled'); 
  • I deduce via Alert returns undefinded - duddeniska
  • if the attribute is not indicated in the tags explicitly, then everything is fine, it should be so - Vitaly Oborin
 $('#btn').prop('disabled', true); // записать $('#btn').prop('disabled'); // прочитать