Below JS function will use for disabling the new tab functionality and it will throw the alert message.
- function disableNewTabClick() {
- var listCtrl = document.getElementsByTagName('a');
- for (var i = 0; i < listCtrl.length; i++) {
- listCtrl[i].onmousedown = function(event) {
- if (!event) event = window.event;
- if (event.ctrlKey) {
- alert("Functionality for Opening links in a new tab/window is disabled !");
- return false;
- }
- if (event.shiftKey) {
- alert("Functionality for Opening links in a new tab/window is disabled !");
- return false;
- }
- if (event.shiftKey && event.ctrlKey) {
- alert("Functionality for Opening links in a new tab/window is disabled !");
- return false;
- }
- }
- }
- }

Diamond PhilipPosted Jul 19, 2021, 10:42 AM
Were is it called in the page
Ravi ShekharPosted Oct 21, 2013, 2:05 PM
Nice blog sudheer sir. It is helpful