I just fixed this issue but I am still puzzled on why I was having trouble. When trying to hide a div I tried to use this code:
<div id = myDiv></div>
function MyFunction(){
$('#myDiv').css("display", "none");
}
That code would not work when trying to hide the div, but this will
function MyFunction(){
$('#myDiv').hide();
}
I wanted to know what the difference was between each of these methods, and why one would work while the other did not.
This is a problem
You have to do like this
Since both .hide() and .css() will add “display: none” to your element, the above code is the only thing I could think of. Always use “” with attributes.