Difference between disabled bootstrap class and disabled attribute

Greetings, I use the disabled class as well as the disabled attribute as follows, but I don’t know the main difference between them and when we should use the class and when to use the attribute, please clear my doubts I use the button in my code and I want to disable it to make the best use of the disabled class or disable the attribute

    <button class="btn btn-primary disabled" type=" button"/>
    disabled="disabled"
+4
source share
1 answer

If you look at bootstrap definitions, disabled styles are always defined for the presence of a disabled class or a disabled attribute:

.btn.disabled,
.btn[disabled],
fieldset[disabled] .btn {
    cursor: not-allowed;
    ...
}

So, for styling you only need a class or attribute.

pointer-events: none;, . , .

3.3.5 pointer-events: none; .btn. , , , .

.

+6

Source: https://habr.com/ru/post/1608958/


All Articles