How to close a tab or window by clicking on a button in JQuery? I tried window.close() thinking that it would close that window,but it doesn't seem to work. Someone help me.
<?php echo $javascript->link('jquery');?>
<script type="java/javascript">
$(document).ready(function(){
$(".close").click(function(){
window.close();
});
});
</script>
<div class="close">
<?php echo $form->button('Close Window');?>
</div>
EDIT
Sorry,The code is correct. The answer didn't come due to a very silly mistake of mine. I had typed script type as java/javascript instead of text/javascript.Now I have changed it and this works fine.