I'm using div with some inline style and also i'm using a class to override the inline style. I need to change the border of the div while button click. I used the following code but it doesn't work?
HtML Code:
<div id="test2" class="test" style="height:30px; width:150px; background-color:red; border:1px solid green;"></div>
<button id="test1">Test</button>
Class Style
div.test{
border:2px solid black !important;
background-color:blue !important;
}
Button Code
$('#test1').click(function(){
$('#test2').css('border','none !important');
});
Demo: For demo please click HERE.
Please give some suggestions to change the css of the element.