javascript
If Event Target

if event target getAttribute

document.addEventListener("click", function(event) {
    if (event.target.getAttribute("id") != 'divOne' && event.target.getAttribute("id") != 'divTwo') {
        document.getElementById("divOne").style.display = "none"
    }
});