title: jQuery on click call function with parameters
body: <p>When I click on any of the buttons, it tells me showElement is not defined.I'm looking to create a reusable function called showElement which can be called whenever I want to show a div by passing an id of that div. What am I doing wrong? <a href="https://jsfiddle.net/2taswyy6/20/" rel="nofollow noreferrer">https://jsfiddle.net/2taswyy6/20/</a></p>
  
  <p>This is my html:</p>
  
  <pre><code>&lt;button onclick="showElement('div1')"&gt;
  Show Div 1
  &lt;/button&gt;
  &lt;button onclick="showElement('div2')"&gt;
  Show Div 2
  &lt;/button&gt;
  
  &lt;div hidden id="div1"&gt;Showing Div 1&lt;/div&gt;
  &lt;div hidden id="div2"&gt;Showing Div2&lt;/div&gt;
  </code></pre>
  
  <p>updated: This is my jQuery:</p>
  
  <pre><code>  function showElement(id){
      $('#'+id).show()
    }
  </code></pre>