I try to add a border property using JavaScript to a div. I used this code.
var element = document.getElementById("divID");
element.style.border="3px #0099ff solid !important;"
But it want come. If I used,
element.style.display="none;"
It works. Also I tried the JQuery approach,
$("#divID").css("border","3px #0099ff solid !important;");
That is also not working. These are the CSS properties of the element. Can you tell me the reason for this?
One has marked this as duplicate. But the thing is I have used the code given by How to apply !important using .css()?,
var divID='#'+i + selectedEvent[0].percepticDrillDowns[j].id + '_div';
var div = $(divID);
div.style('border', '3px #0099ff solid');
But it gives an error saying style is not a function of div.