I am simply appending an element that is on the DOM like:
$("#div_element").append('<a href="#">test</a>');
Right after I append it I need access to the element I just made in order to bind an click function to it, I tried:
$("#div_element").append('<a href="#">test</a>').click(function(){alert("test")});
But the above didn't work. I could uniquely id the element but that seems like a bit to much work when perhaps there is a way I can get the element right after I append it.