title: Passing parameters in Javascript and html
body: <p>In the code below I need to toggle the text for the three buttons between &quot;Show&quot; and &quot;A&quot;, &quot;B&quot;,C&quot; when clicked. With the current code, nothing happens when the buttons are clicked.</p>
  <pre><code>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt; 
  &lt;html&gt; 
  &lt;head&gt; 
  
  &lt;style&gt;
  .placeholder {
      padding: 0 0 0 5px;
  }
  &lt;/style&gt;
  
  
  &lt;script&gt;
  
  function mFunction() {
  document.querySelectorAll('[data-placeholder]')].forEach( item =&gt; {
    item.addEventListener('click', () =&gt; {
        var x = item.querySelector('.placeholder');
        x.innerHTML = x.innerHTML === &quot;&quot; ? item.dataset.placeholder : &quot;&quot;;
    });
  });
  
  &lt;/script&gt;
  
  
  &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
  &lt;title&gt;test&lt;/title&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;p&gt;
  
  &lt;button onclick=&quot;mFunction()&quot; data-placeholder=&quot;A&quot;&gt;Show&lt;span class=&quot;placeholder&quot;&gt;&lt;/span&gt;&lt;/button&gt;
  &lt;p&gt;
  &lt;button onclick=&quot;mFunction()&quot; data-placeholder=&quot;B&quot;&gt;Show&lt;span class=&quot;placeholder&quot;&gt;&lt;/span&gt;&lt;/button&gt;
  &lt;p&gt;
  &lt;button onclick=&quot;mFunction()&quot; data-placeholder=&quot;C&quot;&gt;Show&lt;span class=&quot;placeholder&quot;&gt;&lt;/span&gt;&lt;/button&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  
  </code></pre>