Can you just help me to provide javascript code which simulates CTRL+W event. Basically CTRL+w is used to close current browser tab. Here i want to perform similar operation through Javascript code.
Thanks in Advance.
Can you just help me to provide javascript code which simulates CTRL+W event. Basically CTRL+w is used to close current browser tab. Here i want to perform similar operation through Javascript code.
Thanks in Advance.
Try this
$(window).keypress(function(event) {
if (event.which == 119 && event.ctrlKey){
event.preventDefault();
alert("Ctrl-W pressed");
}
});