78
rated 0 times
[
82]
[
4]
/ answers: 1 / hits: 31566
/ 13 Years ago, wed, february 22, 2012, 12:00:00
I have this simple HTML code:
<div id=new_gallery>
<p id=add_gallery>Add new gallery</p>
</div>
and jQuery code:
<script>
$(#add_gallery).click(function() {
$(#new_gallery).append('<input namenew_gallery /><a href=# id=create_new_gallery>Add</a>');
$(this).remove();
});
$(#create_new_gallery).on('click', function(){
alert('1');
});
</script>
First function is working, but second one is not. I need to create new input
element, send data via ajax, and then delete the input
element and append a p
element once again. How can I do this?
More From » jquery