I'm utilizing a div element with some inline style and a class to override said inline style. My goal is to alter the border of the div upon button click. I attempted the code below, but it did not yield the desired result.
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: To view a demo, please click HERE.
Please provide any suggestions on adjusting the CSS properties of the element.