0

I'm trying to process a form with AJAX, and then (after the response comes back through), make a popup that gives a user 2 buttons.

The first AJAX request executes just fine, and the popup appears properly too. The issue is that one of the buttons in the popup does nothing when pressed.

The button in question is addressed with the following code:

$(".c").on("click", function(){
    alert('dfgh');
});

The HTML of the popup (created by the original AJAX request) is:

<div id="exchange_pc" class="popupContainer" style="z-index: 1000;">
    ….text….
    <table>
        <tbody>
            <tr>
                <td>
                    <form class="removeAndApply" action="">
                        ….hidden inputs….
                        <button type="submit">XYZ</button>
                    </form>
                </td>
                <td>
                    <button class="c">Keep Current Codes</button> //this is the button I'm asking about
                </td>
            </tr>
        </tbody>
    </table>
</div>

Weird thing is, that when I create a regular old button it works just fine. Only in the generated popup it doesn't. (Even though it's dynamically created, my understanding is that using ".on()" should make it work…)

Jo.P
  • 1,029
  • 4
  • 13
  • 31

0 Answers0