For example i have such code:
$("#total").html("Price $<span>" + value + "</span>");
And i also want to add a href button there
$("#total").html("Price $<span>" + value + "</span><a id='remove' href='#'>remove</>);
But how i may add onclick event for that a href?
UPDATE
I really like that solution:
//Create the link to remove the item beforehand, and add the onclick event handler.
var removeLink = $("<a id='remove' href='#'>remove</a>").click(function(e) {
//Click event handler here.
});
$("#total").html("Price $<span>" + value + "</span>"); //Create the price value
$("#total").append(removeLink); //Add the remove link.
Because there is a lot of remove links going to be on my form, but i have a question how to pass any parameters to that click function in such case?