How do I pass parameters into a jQuery.click() function on a <span> tag? <p>I have used the jQuery.click() function in the past with buttons and have had nothing but success, but I tried to use it to click on a <code>&lt;span&gt;</code> and it doesn't work.</p> <p>Also I noticed that it automatically executed my function without listening to the click.</p> <p>Judging how I used it on buttons, this would be the syntax:</p> <pre><code>&lt;p&gt;&lt;span id="example"&gt;Click Here&lt;/span&gt;&lt;/p&gt; $("#example").click(exampleFunction(p1, p2)); </code></pre> <p>But it does not seem to work. Again it just executes it without the click even taking place. I even tried:</p> <pre><code>$(document).on("click", "#example", exampleFunction(p1, p2)); </code></pre> <p>Still no luck, same results.</p> <p>I am making a weather app and my goal with this is to toggle the temperature between Fahrenheit and Celsius by clicking on the unit. I made a copy of the code for the app on codepen.io here:</p> <p><a href="http://codepen.io/estermer/pen/wWvJrV?editors=1010" rel="nofollow">Codepen Weather App</a></p> <p>I appreciate the help!</p>