I have the following table that I need to display a tooltip of the persons picture based on the unique staff id:
The following code works in regards to displaying the correct url how can I make the tooltip display the img of the url instead of it just being the text of the url.
code is as follows:
$('#ctl00_m_g_615c4803_912c_4ba4_8415_8082f2df612c_ctl00_resultsGrid').dataTable();
$('#ctl00_m_g_615c4803_912c_4ba4_8415_8082f2df612c_ctl00_resultsGrid tbody tr').each( function()
{
var nTds = $('td', this);
var sn = $(nTds[5]).text();
var urlStart = "<img src='http://portal.blah.local:8081/ColleaguePhotos/";
var urlMiddle = sn;
var urlEnd = "/primary.jpg'/>"
var url = urlStart + urlMiddle + urlEnd;
//alert(url);
this.setAttribute('title', url);
});
});
the output tooltip just displays the text http://portal:8081/ColleaguePhotos/staffnumber/primary.jpg/>;
Thanks all I have used both of your suggestions and found the solution:
The title attribute alone will not allow this.
You should use a tooltip plugin :
or look for other ones