tags:

views:

19

answers:

2
  $('a').click(function () {
             var href = this.href;
             //alert('I was clicked, here my href = ' + $(this).attr('href'));
             var divid = $(this).attr('href');
             $("#" + divid).slideToggle('slow'); // show hide div
             $("#" + divid + "1").slideToggle('slow'); // show hide div
             $("#" + divid + "2").empty();
             $("#" + divid + "4").empty();
             return false;
         });

how will uniquely identify a a href ? . include a id in href and call ?

A: 

an ID is always unique in a page, or at least, it should be. so give your anchor an ID and it should be fixed. an anchor also can have just 1 href. so i'm not sure what you want.

Stefanvds
You mean unique in a page, not in a website.
vlood
how will i get the id in the above code
mazhar kaunain baig
A: 
$('a').click(function () {
    // Get the id of the link:
    var id = this.id;
    $("#" + id + "1").slideToggle('slow'); // show hide div
    $("#" + id + "2").empty();
    $("#" + id + "4").empty();
    return false;
});
Darin Dimitrov