-
-
Save kickboxer/8747506317d0c53f6798 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// СВОЙСТВА И АТРИБУТЫ: prop and attr | |
// ======================================= | |
// PROP - для disabled | |
// правильно | |
$("input").prop('disabled', true); | |
$("input").prop('disabled', false); | |
// не правильно! | |
// $("input").attr('disabled','disabled'); | |
// $("input").removeAttr('disabled'); | |
// если только один элемент, то быстрее будет: | |
this.disabled = true; | |
// ======================================= | |
// ATTR - для class, title и пр. | |
$("div").attr({"class":"divEl", "title":"Див"}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment