This are my jquery functions
var status;
$('.status').click(function(e) {
status= $(this).attr('id');
//$('#test').html('<p>Scrolled: '+ status +'</p>');
callAjax();
display();
});
This function above gets id of the hyper reference clicked and stores it in a variable. and call other function.
var id = [];
var values = [];
function callAjax(){
id = [];
values = [];
$("#"+ status +"> td").each(function(index){
id.push($(this).attr("id"))
values.push($(this).text());
//alert($(this).attr("id")+" "+$(this).text());
});
}
This function above retrives all the values from row and stores it in a array.Using this array values i will create a new table and display it below the hyperlink that was clicked (whose div is stored status variable)
function display(){
$("#"+status).append('<table id="newtable" border="1"> <tr> <td>'+values[0]+'</td><td>'+values[1]+'</td></tr></table>');
}
in display() function when i am first time appending the table its working fine, but when again link is clicked it appends one more table.
output

here when i click on link first time it displays the table correctly, but when i click the same link its appending the same table and second problem is when i click on other link first table should get disappeared.
help...