I have a Rails Page View that is constructed like this:
script>
$('#carnum_driver_plus').click(function () {
alert("click done");
});
</script>
....
<%= form_tag(.....(method: :post)) do %>
<button id="carnum_driver_plus" type="button">
<span class="glyphicon glyphicon-plus align-text-bottom" aria-hidden="true"></span>
</button>
<% end %>
When I load this page the first time, the click handler worked and called the alert function. When I submit the form, it will be processed by a controller action, and then the same page view will be rendered. But then when I click the button again, nothing happened, the alert will not be called.
Any ideas?