When I open a modal I want the button to be disabled upon opening the modal. 

But, this does not work:

```
$( '#addToCartNF' ).prop('disabled', true);

```

I know that if I wanted to click on it I would have to do something like:

```
$( 'body' ).on('click', '#addToCartNF', function() {

```

but I am not sure how to target the button inside the modal upon opening it. 

```
 $( '.outlet' ).on('click', function(e) {
           e.preventDefault();
           var prodName = $(this).data('prodname');
           var prodId = $(this).data('id');

           $.ajax({
               url: url + '/CartAjax/ajaxModal',
               type: 'POST',
               data: {prodId: prodId},
               beforeSend: function() {
               $( '.outlet' ).prop('disabled', true);
               $( '.obtext' ).hide();
               $( '#outletspinner' ).show();

           },
           })
           .done(function (data) {
                 var modal = `

                    <div id="myModal" class="modal fade" role="dialog" data-backdrop="static" data-keyboard="false">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                                    <h4 class="modal-title">${prodName} </h4>
                                </div>
                                <div class="modal-body">

                                <div>
                                    <select class="form-control" id="branches">
                                        <option value="">Select Outlet</option>
                                        ${data}
                                    </select>
                                </div>

                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default closeBranchModal">Close</button>
                                  <button class="btn btn-raised ripple-effect cart-btn closeBranchModal" id="addToCartNF" data-id="${prodId}"><div class="spinner" style="display: none;"></div><span class="cartBtnTextNF">ADD TO CART</span></button>
                                </div>
                            </div>
                        </div>
                    </div>  
                    `;

                $(modal).modal(); 
                $( '#outletspinner' ).hide();
                $( '.obtext' ).show();
                $( '.outlet' ).prop('disabled', false);
           })

                .fail(function (jqXHR, textStatus, errorThrown) {
                console.log(textStatus + ': ' + errorThrown);
                console.warn(jqXHR.responseText);
            });
       })

```