title: how to check if element has already been clicked javascript
body: <p>I'm trying to add multiple event listeners a <code>UL</code> in javascript. </p>
  
  <p>How can I create a condition to <code>.preventDefault()</code> if one of my <code>.card</code> elements has already been clicked? </p>
  
  <pre><code>const cd = document.getElementById('listDeck')
  cd.addEventListener('click', flipFirst, false)
  
  
  function flipFirst(e) {
    if (e.target &amp;&amp; e.target.nodeName == "LI") {
      var firstMove = document.getElementById(e.target.id)
      firstMove.classList.add('open', 'show')
      console.log('first card was clicked')
      e.currentTarget.removeEventListener('click', flipFirst);
    }
  }
  
  cd.addEventListener('click', function(evt) {
    if () {
      //condition is true
      //then prevent default
    }   
      var secondMove = document.getElementById(evt.target.id)
      secondMove.classList.add('open', 'show')
      console.log('second card was clicked')
  })
  </code></pre>