title: Check if an element has event listener on it. No jQuery
body: <p>How to check if an element has event listener on it, if I use an inline function on it like the code below? Because I have a function that recalls the function and add the event listener, but it cause to have duplication event listener causing it to trigger a function twice. How can I check it so I can prevent it to add an event listener if is it already exist?  </p>
  
  <pre><code>for (var a = 0;a&lt;formFieldInput.length;a++) {
      if(formFieldInput[a].hasAttribute("name") &amp;&amp; formFieldInput[a].attributes.title.value !== "Valid Until") {
          formFieldInput[a].addEventListener("click",function(event) {
              toggleFieldList(event,"show");
          });
      }
  </code></pre>