I have two anchor links One is `Like` and Second is `Favorite` Now I am trying get alert when user click to specific option.

If user click to `Like` option `alert('Like Clicked');` 

or

If user click to `Favorite` option `alert('Favorite Clicked');`

but something is wrong and getting multiple alerts with Like and Favorite.

Whats wrong with my code I can't understated.

**MY JS WORK:**

```
$(window).load(function(){
    $('.ovrly a').click( function () {
        var getImageID = $(this).attr("id"); //class name with id

        if($(".like").children("."+getImageID)) {
            alert('Like Clicked');  
        }

        if($(".fav").children("."+getImageID)) {
            alert('Favourite Clicked'); 
        }
    });
});

```

**MY HTML WORK:**

```
<div class="ovrly">
    <span class="like">
        <a class="like_32" id="like_32" href="javascript:void(0);">Like</a>
        <p class="likeCount_32">
            15
        </p> 
    </span>

    <span class="fav">
        <a class="favourite_32" id="favourite_32" href="javascript:void(0);">Favourite</a>
        <p class="favouriteCount_32">
            09
        </p> 
    </span>
</div>

```

My Sample [JS FIDDLE](http://goo.gl/jzTM87)

**My Sample Code With Ajax Code:**

```
<script type="text/javascript">
    // like and favourite ajax script
    $(function () {
        $('.load_more_ctnt .ovrly a').live("click", function () {
            var getImageID = $(this).attr("id"); //class name with id
            var getID = getImageID.replace(/[^0-9]+/g, ""); //only id
            var getOptionName = getImageID.replace(/[^A-Za-z]+/g, ""); //only id
            //alert(getImageID);

            $(document).ajaxStart(function() {

                if($(".like").children("."+getImageID).length > 0) {
                    alert('Like Clicked');  
                }

                if($(".fav").children("."+getImageID).length > 0) {
                    alert('Favourite Clicked'); 
                }

            }).ajaxStop(function() {

               if($(".like").children("."+getImageID).length > 0) {
                    alert('Like Clicked');  
               }

               if($(".fav").children("."+getImageID).length > 0) {
                    alert('Favourite Clicked'); 
               }

            });

            if (getImageID) {
                $.ajax({
                    type: "POST",
                    url: "<?php echo URL; ?>home/passImageID",
                    data: "getImageID=" + getImageID,
                    success: function (html) {
                        $("#" + getImageID).removeAttr("id");

                        if(html == 'like'){
                            $("." + getImageID).addClass( "iplike" );
                            var incrementBy1 = $(".likeCount_" + getID).text();
                            var tempLikeNewValue = +incrementBy1+1;
                            $(".likeCount_" + getID).text("");
                            $(".likeCount_" + getID).text(tempLikeNewValue);

                        }else{

                            $("." + getImageID).addClass( "ipfav" );
                            var incrementBy1 = $(".favouriteCount_" + getID).text();
                            var tempFavNewValue = +incrementBy1+1;
                            $(".favouriteCount_" + getID).text("");
                            $(".favouriteCount_" + getID).text(tempFavNewValue);

                        }

                    }
                });
            } else {
                 //$(".more_tab").html('The End');
            }

            return false;
        });
    });
 </script>

```