Can anyone tell me whats wrong with this function? Everything works as it should right up until i try to change the title attribute, last line. It does not change and has the original value. Im using the title attr as a notification on mouse over
P.S. Javascript/jQuery is not my strong point im a C# developer so please be nice.
function doAlerts(serverDateTime)
{
$('.alertText').each(function()
{
var getCell = $(this).find("td").eq(0).html()
var respCount = $(this).find(".messageCount").val();
var callerId = $(this).find(".messageCallerID").val();
var getTitleText = $(this).attr('title');
//get date and title from row off page
var createDate = $(this).find('.createdDate').html();
var titleText = $(this).attr('title').replace('Expected SLA : ', '').replace('Expected Response : ', '');
var title = "Ticket No : " + getCell + "<br>" + getTitleText.replace(' - ','<br>') + "<br>";
var slaResult = warning(titleText, serverDateTime, 20, "SLA");
var expResult = warning(titleText, serverDateTime, 60, "Exp");
if(slaResult)
{
$(this).addClass('warning');
$(".warning").css("background-color", "#FFdddd");
title = title + "<br>There is less than 20mins before expected 4 hour SLA.<br>";
}
if(expResult)
{
$(this).addClass('warning');
$(".warning").css("background-color", "#FFdddd");
title = title + "<br>There is less than 60mins before expected 24 hour response.<br>";
}
if(respCount)
{
if(respCount > 5)
{
$(this).addClass('warning');
$(".warning").css("background-color", "#FFdddd");
title = title + "<br>There has been " + respCount + "messages. A phone call is required to the client<br>";
}
}
$(this).attr("title", title);
});
}