1
I have the following JS for my modal:
<script type="text/javascript">
    $('#modal').modal('hide');
    $('.linkModal').on('click', function(event){
        event.preventDefault();
        var title = ($(this).attr("title"));
        if($(this).attr('modalSize')){
            var modalSize = $(this).attr('modalSize');
        }
        $('#modal .modal-body, #modal .modal-title').empty();
        $.ajax({
            url: $(this).attr("href"),
            type: 'GET',
            context: $('#modal'),
            success: function(data){
                if(modalSize){
                    $('#modalDialog').addClass(modalSize);
                }
                $("#modal .modal-title").append(title);
                $("#modal .modal-body").append(data);
                $('#modal').modal('show');
            }
        });
    });
    $('#modal').on('hide.bs.modal', function () {
      $('#modalDialog').removeClass('modal-lg'); //QUERO REMOVER ESTA CLASSE do ID="modalDialog". Como fazer?
    });
    $(".chosen-select").chosen();
</script>
I want to remove the class modal-lg of ID="modalDialog" when to close the modal. How to do it? The way I did it is not working.