Check if ID is selected with jQuery
<p>Good Day.</p>

<p>I am using the following click function with jQuery </p>

<pre><code> $(function () {

            $("#areas ul a").click(function (event) {
                event.preventDefault();
                $("#areas ul li a").removeClass('activeAreas');
                $(this).addClass('activeAreas');
                $(".hidden").hide(200);
                $($(this).attr("href")).show(500)

            });

        });
</code></pre>

<p>What what I would like to do is in that loop, to check whether a specific element is active, then act upon that:</p>

<p>Eg.</p>

<pre><code> $("#areas ul a").click(function (event) {
                event.preventDefault();
                $("#areas ul li a").removeClass('activeAreas');
                $(this).addClass('activeAreas');
                $(".hidden").hide(200);
                $($(this).attr("href")).show(500)

                //I'm adding this... but it is not working

                if($(this).attr(href) = 'pretoriaDetail'){
                  alert('it works');
                }

            });
</code></pre>

<p>How do I get that if statement to work...?</p>

<p>Thanks</p>
