I admittedly don't know much about JQuery but I have an AJAX form where I need to trigger a click event when someone clicks the submit button, but because the button is not there initially, but on page three of the same form (The URL doesn't change),I'm having issues using the click event.
In my code, I just want to run a function when a button is clicked.
<script type="text/javascript">
//Run function when button is clicked
$(document).ready(function () {
$("#idOfButton").click(function () {
doSomething();
});
});
//The function I want ran when page visitor clicks button
function doSomething() {
//Do Something
}
</script>
Obviously this code doesn't work, but any suggestions on how to use .click? I'm only able to insert JS via a tag management system, so I can't hard code anything into the page. Also, the JQuery version is 1.4, so I can't use .on. Thanks for your help.