Trying to choose the anchor tags that are descendants of a div with a specific identifier, for example, #mydiv1, #mydiv2and #mydiv3.
myFunction = function() {
var theDivs = $("#mydiv1, #mydiv2, #mydiv3");
theDivs.hover(function(e){
$(this+" a:link").css("color","#99ccff");
},function(e){
$(this+" a:link").css("color","#848484");
});
}
The selector $(this+" a:link")seems to choose nothing.
Does anyone have any thoughts on the correct syntax for this choice?
source
share