How to close the current tab using jQuery?
Please guide me,
To close the current tab using jQuery.
function closeCurrent() {
var x = confirm('Are You sure want to exit:');
if(x) {
//window.open('invalidUrl.html', '_self', ''); // not works
//window.open('invalidUrl.html', '_self', ''); // not works
//window.open('invalidUrl.html', '_self', ''); // not works
window.close();
}
}
<button onClick="closeCurrent();">CLOSE WINDOW</button>
Thanks,
Surendar