views:

66

answers:

1
A: 

From your script:

$("#spotlightright a").click(function(){
//these two assignments are fine, because "href" and "title" are both attributes of "a" tags
 var largePath = $(this).attr("href");
 var largeAlt = $(this).attr("title");

//these two are not, an "a" does not have "h2" and "p" attributes
 var featureHead = $(this).attr("h2");
 var featureText = $(this).attr("p");

Solution: Directly reference the elements containing the text you are trying to copy over, e.g.

var featureHead = $('h2#example').text();
var featureText = $('p#example').text();
karim79
awesome !so if that is how I reference the elements, how do I implement them after the reference ?
suBi
also since there are individual 'h3' and 'p' elements for each 'this' item, shouldn't they be in a loop?
suBi