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');
    }
});