Hi,
I want to add an anchor tag inside a gridview as per some condition
here is my code
$("#GridView1 tr td").filter(":not(td:first-child)").each(function () {
var cellText = $(this).text();
if ($.trim(cellText) == '')
{
$(this).css('background-color', 'LightGreen');
$(this).append("<a class='anchor1' href='#' title ='click here for book'>available</a>");
}
else
{
$(this).css('background-color', 'red');
var name = $(this).text();
$(this).append("<a class='anchor3' id='" + headertext + "-" + firstcelltext + "' href='#' >'"+name+"'</a>");
}
});
my requirement is in the else condition
celltext is booked
i want to add anchor tag inside the word booked like this
<a class='anchor3' href='#' >booked</a>");
i tried this code
$(this).append("<a class='anchor3' href='#'>'"+name+"'</a>");
I got the result as booked 'booked' means repeating the word.
i want to avoid this.
How to solve this.
Regards
Baiju