You are thinking too complicated this should do:
$(document).ready(function() {
$("a.trigger").click(function(){
$(this.hash).css({background: "red" });
});
});
Regards
[EMAIL PROTECTED] wrote:
>
> I just know this is a dumb question with a simple answer, but here goes...
> I have something like:
> #div1 Link a
> #div2 Link a
>
> and
> <div id="div1"></div>
> <div id="div2"></div>
>
> I need to match the link to it's div, but can't figure out the selector.
> Non
> working test js is:
> $(document).ready(function() {
> $("a.trigger").each(function(i) {
> targetDiv = $($(this).href);
> targetDiv.style.background = "red";
> });
> });
>
> So how do I match the link to it's div?
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>
>
--
View this message in context:
http://www.nabble.com/Finding-element-that-matches-anchor-link-tf3234867.html#a8991866
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/