Not Able To assign click event
===

I have following html code. In my page there are many <a> tag which have class='posta' but what i want assign onclick event only to which have post attribute.


    <ul class="posts_li">
            <li>
                <a href="#" class="posta" post="status">Post</a>
            </li>
            <li>
                <a href="#" class="posta" post="act">Act</a>
            </li>
            <li>
                <a href="#" class="posta" post="event">Event</a>
            </li>
            <li>
                <a href="#" class="posta" post="news">Create News</a>
            </li>
        </ul>




My Jquery Code for assigning an event is here


    $(".posta").click(function(){
                alert("here");
                if($(this).attr("post")){
                    alert($(this).attr("post"));
                }
            });