Why is this jQuery code not working?
<p>I am trying to make a simple tool tip function (I'm trying to learn jQuery so please don't suggest plugins for this). When I write it like this it works:</p>

<pre><code>             $('span.toolTip').hide();
             function toolTip() {
                $('.targetLink').mouseover(function() {                
                    $('.toolTip').show().html('Hello there');
                });
            }

            &lt;span class='toolTip'&gt;&lt;/span&gt;
            &lt;a href="#" class="targetLink"&gt;Hover over me&lt;/a&gt;
</code></pre>

<p>But when I try to pass parameters through the function it doesn't work:</p>

<pre><code>    $('span.toolTip').hide();
    function toolTip(target, tooltip, message) {
        var target = '.' + target;
        $(target).mouseover(function() {
            var tooltip = '.' + tooltip;
            $(tooltip).show().html(message);
        });
    }

    toolTip('targetLink', 'toolTip', 'Hello There');

    &lt;span class='toolTip'&gt;&lt;/span&gt;
    &lt;a href="#" class="targetLink"&gt;Hover over me&lt;/a&gt;
</code></pre>
