Javascript below is used to close div when an ESC Key is clicked.
<script>
$(document).keyup(function(event) {
if(event.which === 27) {
alert('closed now');
$('#content').hide();
}
});
</script>
<div id="content">My content to be closed is here</div>
Now what I want is to close the content from a button click which will then call Esc Key javascript function
<button id="close_content">Close</button>
Thanks