title: How to check whether the clicked element is having background property using pure Javascript?
body: <p>I want to check whether the element i click on page is having a background property and this is the code i tried</p>
  
  <pre><code>var img = document.querySelectorAll('*');
  
  img.forEach(function(image){
    image.addEventListener("click",function(e){
        e.preventDefault();
        if(this.style.background){
           console.log("yes");
        }
      });
  });
  </code></pre>