JQuery toggle function within ASP.NET gridview

JQuery toggle function within ASP.NET gridview

First let me say I'm very new to JQuery.

I do not understand why my very simple jQuery function works on my aspx page under this scenario:

$(document).ready(function() {
    $('a#ctl00_cphMainContent_HyperLink1').click(function() {
    $('div#myDiv').toggle('slow');
    });
});


but will not function under this scenario:


$(document).ready(function() {
    $('a#ctl00_cphMainContent_repLines_ctl00_repTerm_ctl00_gvPlacementList_ctl01_HyperLink1').click(function() {
    $('div#myDiv').toggle('slow');
    });
});




Obviously, the difference being that HyperLink1 is nested within the HeaderTemplate section of a GridView control, which is in turn nested within two repeater controls. The control shows up fine in the source, but jQuery doesn't seem to find it.

I don't have a clue! any assistance is much appreciated!