jquery: how to write a simple function?
<p>How do you create a function in jQuery, call it, and pass a variable to it?  Here it is in Javascript style:</p>

<pre><code>&lt;script type="text/javascript"&gt;
function popup(msg) {
  alert(msg);
}
&lt;/script&gt;
</code></pre>

<p>Then you would simply include the event in the HTML:    </p>

<pre><code>&lt;html&gt;
&lt;input type="submit" onclick="popup('My Message')" /&gt;
&lt;/html&gt;
</code></pre>

<p>What is the jQuery equivalent to doing this?  From all the "newbie" tutorials, they are all static functions that do not accept variables.  For example:</p>

<pre><code>&lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
$(document).ready(function() {
  $('button').click(function() {
    alert('hello, world');
   });
});
&lt;/script&gt;
</code></pre>

<p>I want to be able to dynamically include different messages.  The code above affects all buttons and spits out the same message of 'hello, world'. </p>
