Reducing duplicated code with JQuery function
<p>Found a good jquery popup function here: </p>

<pre><code> JAVASCRIPT
 $(function() {
    $("#word1234").live('click', function(event) {
        $(this).addClass("selected").parent().append('
          &lt;div class="messagepop pop"&gt;"Lorem ipsum dolor sit amet, 
          consectetur adipisicing elit, sed do eiusmod tempor incididunt&lt;/div&gt;');
        $(".pop").slideFadeToggle()
        $("#email").focus();
        return false;
    });
    $(".close").live('click', function() {
        $(".pop").slideFadeToggle();
        $("#contact").removeClass("selected");
        return false;
    });


 HTML
 &lt;a href='/word1234' id='word1234'&gt;Supercalifragilisticexpialidocious&lt;/a&gt;
</code></pre>

<p>Is there a more efficient way of invoking this popup?  If I have hundreds of definitions on a page I'd be repeating a lot of code seemingly unnecessarily.  </p>

<p>If I were doing this in native JS, I'd just set a onClick function to the href tag,something like</p>

<pre><code> &lt;a href="#" id="word1234" onClick="doPop(this, 'Lorem ipsum, ect.')"&gt;Supercalifragilisticexpialidocious&lt;/a&gt;
</code></pre>

<p>Is there a similar method of calling a function in JQuery?</p>

<p><strong>EDIT</strong>
After some debugging, a working version of the updated/fixed script can be found here: <a href="http://jsfiddle.net/N4QCZ/13/" rel="nofollow">http://jsfiddle.net/N4QCZ/13/</a>  hth.</p>
