I have a Jquery function that when a button add_entry is clicked, inserts a 'save button' inside the page like this; the button shows up, so I assume that part is working.
$("#add_entry").click(function(){
$("#add_entry").hide();
$('#status').append(<button class="save_entry">Test</button>);
});
then I have yet another function that is supposed to be called when aforementioned save button is clicked:
$(".save_entry").click(function(){
alert("i dont work :/");
});
which makes me wonder...
a) How does DOM manipulation actually work? - Since the jquery part is wrapped into the $document.ready() method does that mean i cant access 'on-the-fly' created elements like that ?
b) when injecting elements with DOM manipulation, they never appear in the source... why?
Thank you for your time.