HTML modal

Title Code
Url pass js to modal
https://laracasts.com/discuss/channels/laravel/pass-an-id-to-a-modal-window-and-then-delete-a-record
model data pass
 <div class="p-2 my-1 border border-primary item_remove" data-toggle="modal" data-target="#item_remove" data-id='123' style="cursor: pointer;">
    </div>

    <div class="modal fade" id="item_remove" data-backdrop="static" data-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" style="display: none;" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header py-2">
                    <h5 class="modal-title" id="staticBackdropLabel">Item remove</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                    </button>
                </div>
                <h5 class="modal-body text-danger">                                    
                    Are you want to remove this item?
                </h5>                
                <div class="modal-footer py-2">
                    <button type="button" class="btn btn-secondary px-3" data-dismiss="modal">No</button>
                    <button type="button" onclick="" data-dismiss="modal" class="btn btn-danger yes px-4">Yes</button>
                </div>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        $(document).on("click", ".item_remove", function () {  
        Or
        $('.item_remove').click(function() {             
            var id = $(this).data('id');
            $('.yes').attr('onClick','item_remove('+id+')');
        });

        function item_remove($id){
            var id = $id;
            var action = 'remove';
            $.ajax({
                url:"action.php",
                method:"POST",
                data:{
                    id:id,
                    action:action
                },
                success:function(){
                    location.reload();
                }
            });
        }
    </script>