count number of links in textarea using jquery
<p>I am trying to count the number of links in a textarea so I can limit the user to no more than three links. The code below is what I have so far, but it's not working. I am thinking the html is encoded and that is affecting it somehow ...or maybe not. If so, can I decode it? Any ideas? Thanks so much.</p>

<pre><code>$(document).ready(function() {
    $('#box-text').keyup(function() {
            var links = $('#box-text a');
            var total_links=0;
            for(var i = 0; i &lt; links.length; i++) {
                total_links++;
            }
            alert("links =  " + total_links);
    });
});
</code></pre>
