How can I use jQuery to get a specific instance of a class (headerGrid) in Div (products).
I need to be able to get an instance of the classGrid class called "Get this text." An instance is represented as a value in swap2 (). My code is as follows:
<table id="products"> ... <tr> <td> <a onclick="swap2(1);"><img src="images/products/thumbs/image.png"/></a> </td> <td valign="top" class="product-text"> <span class="headerGrid">Get this Text</span><br /><br /> text </td> </tr> ... </table>
eg. if onclick = "swap2 (5);" then I need to get the 5th instance of ".headerGrid"
EDIT
Next, I need to select the text ("Get this text"), and not the object itself. Another wise returns an object [object Object].
I also tried selecting with .innerHTML, which returns undefined.
source share