I'm using js to add form elements into the html document. For instance, I'm adding an entire <form>
to a table cell. Eg:
<form class="add-comment"><input type="submit" /></form>
I try to use js to invoke events based on elements within that newly created form but nothing happens. I should get an alert box. What am I doing wrongly?
$('.add-comment').submit(function() {
alert('form submitted!');
});
Thanks. Hope I explained it well enough.