I have the following problem:
I have a button like: <button id="button_show_countries" >Start</button>
in the index.html
and a click event in the view.js:
$("button#button_show_countries").click(function() {
debug('View Click Event triggered: notice the Controller that the user wants to see the Interests data');
Controller().countrieslandscapeasked();
});
This wokrs very well. Now I create with the view a button. This button I add to index.html. The button looks like:
<button class="insertButton" type="button" id="insert_button_0">insert here</button>
and in the view is also an eventlistener for this:
$("#insert_button_0").click(function() {
debug('Data should be add at Position 0');
});
But when I click on the button the event is not "fired". What is wrong with my code? :/ The button work, if I add him at the beginning like the show countries button. Is it problematic that I add the button dynamically at runtime?
Thanks for help.