<input class= "disabled" > does not disable the default behavior of the button
<input disabled= "disabled" > can suppress the default behavior of an element
jquery or JS
Class= "disabled" element is not clicked
Like what
<a id= "postcomment" class= "btn" > Submit </a> Click Effective
<a id= "postcomment" class= "btn disabled" > Submit </a> Click Invalid
Thank you!
1 eg 2 <ul>3 class= "disable" > Announcements </a></li>4 <li ><a href= "#"class= "disable" > Rules </a></li>5 <li><a href= "#" class= "disable" > Forum </a></li>6 <li><a href= "#" > Security </a> </li>7 <li><a href= "#" > Public Welfare </a></li>8 </ul>
As long as the normal bootstrap, non-custom ... Introduce disable class can!!
For the disabled style in bootstrap, it does not seem that the default behavior of the A tag is handled, which is probably why it can still be triggered, although it has a disabled style set.
Solution:
1. Add CSS to prevent the triggering of a tag
1 . disabled{2 pointer-events:3 }
1 <!--prohibited status--2class= "pager" >3 class= "disabled" > <a href= "http://v3.bootcss.com/" >« previous </a></li>4 <li><a href = "#" > Next »</a></li>5 </ul>
2. JQ
1 $ (". disabled"). Click (function (event) {2 event. Preventdefault (); 3 });
Why can't I disable the click function when I add the disabled class name to the Li tag? This is not set in the bootstrap.js, okay?