title: Passing parameters to a jquery function from a button click
body: <p>I have to be able to change the colour of text via three buttons (red, blue and black)</p>
  <p>The function I have, which works fine is as follows:</p>
  <pre><code>function btn_click() {
  $(&quot;#col1 p&quot;).css(&quot;color&quot;, &quot;#00f&quot;);
      }
  </code></pre>
  <p>I need to pass two variables to this function, the specific tag (e.g. col1 p) and the hex value from the following function call:</p>
  <pre><code>&lt;input type=&quot;image&quot; value=&quot;&quot; class=&quot;but-blue&quot; onclick=&quot;btn_click();&quot; /&gt;
  </code></pre>
  <p>Can anyone help?</p>