79556876

Date: 2025-04-05 11:18:48
Score: 1
Natty:
Report link

actually i am doing like this now, but when LINK2 is not static, it will be aweful

document.addEventListener('click', function(event) {
    event.preventDefault();
    if (event.target.classList.contains("class1") || event.target.id === "ID1") {
        window.open('LINK2', '_blank');
    } else {
    window.open(urlToOpen, '_blank');
    }
});
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Lucas