How to get attribute values of the element that jquery.qtip2 selects -
my html document looks this:
<span class="mytooltip" id="p21_12" waarde="56"><img...></span>
i want pass values of id
, waarde
attributes function retrieves tooltip text. works if hard-code values :
$('.mytooltip').qtip({ content: { text : get_tooltip_text("p21_12","56") } });
but when try to access attribute values function passed empty values.
$('.mytooltip').qtip({ content: { text : get_tooltip_text($(this).attr("id"),$(this).attr("waarde")) } });
i must doing wrong here.
i'd guess this
gone.. can run each
loop , way:
$('.mytooltip').each(function() { var id = this.id, attr = this.getattribute("waarde"), text = get_tooltip_text(id, attr); $(this).qtip({ content: { text : text } }); });
Comments
Post a Comment