Seeking help to make a div expand and then shrink with one button click. I've tried various methods but the div won't change size. Can someone guide me on why this is happening?
Here is the code, CSS, and HTML for my latest attempt:
$("dasButton").toggle(function(){
$("#div1").height($("#div1").height()+200);
},function(){
$("#div1").height($("#div1").height()-200);
});
});
CSS
#div1{
background-color:#8888ff;
display:block;
height:0px;
overflow:hidden;
border: 1px solid #000;
}
HTML
<input type="submit" class="toggle_div" id="dasButton" value="Enlarge/Shrink div"/><br>
<div id="div1">
display:block;
height:0px;
overflow:hidden;
border: 1px solid #000;
}