In my webapplication, I have the follow pair of function, which open and close a tag , simulating a pop-up windows:
<script>
function load_page(url){
$('#results').css("display", "block");
$('#content').load(url);
}
function close(){
$('#results').css("display", "none");
$('#content').empty();
}
</script>
The first one is working perfectly, but the second don't. I set this function to be called from here:
<div align="right"><button type="button" class="btn btn-lg btn-danger" onclick="close()">Fechar</button></div>
If I replace this code by that other one (without use of the jquery), the method works:
function close() {
document.getElementById("results").style.display = 'none';
document.getElementById("content").innerHTML=' ';
}
Is there any way to do this with jquery?
ps.: this code act on this :
<div class="panel panel-default" id="results">
<div class="panel-heading">
<h1 class="panel-title">Panel title</h1>
<div align="right"><button type="button" class="btn btn-lg btn-danger" onclick="close()">Fechar</button></div>
</div>
<div class="panel-body" id="content">
Panel content
</div>
</div>