title: Storing a function with jQuery data() method
body: <p>The jQuery <a href="http://api.jquery.com/data/" rel="nofollow noreferrer">.data() documentation</a> says the following:</p>
  <blockquote>
  <p>The <code>.data()</code> method allows us to attach data of any type to DOM element</p>
  </blockquote>
  <p>I assume &quot;any type&quot; refers to functions as well. Say I have a div with the id foo as such:</p>
  <pre><code>&lt;div id=&quot;foo&quot;&gt;Foo!&lt;/div&gt;
  </code></pre>
  <p>And I'd like to store a function in it called <code>say</code> that takes a parameter.
  According to the documentation I'd store the function this way:</p>
  <pre><code>$(&quot;#foo&quot;).data(&quot;say&quot;, function(message){
     alert(&quot;Foo says &quot;+message);
  });
  </code></pre>
  <p>My question is, how do I invoke the function with a parameter when I wish to do so.</p>
  <p><code>$(&quot;#foo&quot;).data(&quot;say&quot;);</code> should return the function, but how would I pass a parameter to it?</p>