I made a very simple button click event handler, I would like to have element be appended when button clicked, you can check my code
You are using mootools and not jQuery.
To check if your element exists
if($('#other').length > 0)
So if you do not want to append the element twice:
$("#search_btn").click(function() {
if($('#other').length == 0) {
$("#wrapper").append("I am here
");
}
});
Or, you can use the .one(function)
[doc]:
$("#search_btn").one('click', function() {
$("#wrapper").append("I am here
");
});