I am new to Javascript and was doing a simple website with a modal dialog. I face problems when invoking an event when clicking a button on the modal window:
my modal code:
<div class="modal fade" id="askus_modal" style="display:none" >
....
<div class="modal-footer">
<button class="btn" data-dismiss="modal" id="askus_cancel">Cancel</button>
<button class="btn btn-primary" id="askus_submit" type="button">Submit</button>
</div>
</div>
How do I invoke an alert box(for example) upon the click of Submit button??
I tried:
<script>
$("#askus_submit").live("click", function(event){
alert( "GO" );
});
</script>
and
<script>
$('#askus_modal').on("click","#askus_submit", function () {
alert("GO");
});
</script>
but both are not working.. can anyone help? I am really new to this