I would like to make a button by creating new as every time user require. after user clicked on the button i would like to remove that.
for that i created this sting to html, but not working.
var tool = "";
tool += '<div class="toolTip" id="toolTip">';
tool += '<a href="#" class="btn btn-info saveText btn-xs copy">Save Text</a> </div>';
var rightButton = $(tool).clone();
var i = 0;
var button = $('a.saveText');
$('div').mouseenter(function(){
rightButton.appendTo('body');
})
button.click(function(e){
console.log(++i);
e.preventDefault();
$(this).remove();
})
what was the issue here?