edited my original question
The problem is the same for setting the id off a newly added element or if I use the argument noteid from the function. The result is that every element get's the same id if this function get's looped.
How can I set a different id for every newly added element???
As it is now, the value in the submit event is the same for every element. If I have to loop this function to create multiple notes based on database entry's only the last added noteid is remembered and every element uses that same id.
You can see what happens if you see the page First you have to create like two notes by clicking the icon with the arrow Then delete the top one followed by a page refresh. You wil see the second one is deleted.
newnote(tbnoteid){
$('.wrappertbnote:last').load('tbnote.html .paneltbnote', function() {
var t = this;
var tt= $(t).children(1).children("form").children("#frmnoteid");
$(tt).attr('id' , tbnoteid);
$(".frmremovetbnote:last").submit(function(){
var idvalue = $(tt).attr('id');
$.post("tbnotesact.php",{
noteid: tbnoteid,
action: "remove",
time: timestamp
}, function(xml) {
thanks, Richard