I am trying to add !important in the css attribute using jQuery like
$("tabs").css('height','650px;!important');
but !important has no effect. How to include !important in jquery?
important is used to increase the priority of a CSS property. This ignores the overriding properties. In jQuery, you can use the css() method to manipulate style property of the selector but this doesn't allow to set ! important to property.
$() = window. jQuery() $()/jQuery() is a selector function that selects DOM elements. Most of the time you will need to start with $() function. It is advisable to use jQuery after DOM is loaded fully.
$(document). ready(function() { $('#div_one'). bind('click', function() { $('#div_two'). addClass('large'); }); });
The ! important rule in CSS is used to add more importance to a property/value than normal. In fact, if you use the ! important rule, it will override ALL previous styling rules for that specific property on that element!
Apparently it's possible to do this in jQuery:
$("#tabs").css("cssText", "height: 650px !important;");
Src: http://bugs.jquery.com/ticket/2066
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With