jQuery selector question
Posted
by Jakey
on Stack Overflow
See other posts from Stack Overflow
or by Jakey
Published on 2010-04-13T20:41:26Z
Indexed on
2010/04/13
20:43 UTC
Read the original article
Hit count: 265
jquery-selectors
I have a span and an anchor inside a table cell. I have the anchor set up to show a tooltip. I would like the text inside the span to be used for the tooltip. How can I select this text in jQuery?
<td class="row-head" colspan="5"><span class="tip-text">Complete Coverage</span><a href="#" class="help"></a></td>
JQuery code - the current selector always finds the first instance only for all tips.
$(document).ready(function() {
$('.help').qtip({ style: { name: 'cream', tip: true }, content: { text: $(this).find('span.tip-text').html() } }); });
Thanks
© Stack Overflow or respective owner