JSFiddle - React, Tailwind, and code Playground
HTML
<!--Right modal-->
<!-- Full Height Modal Right -->
<div class="modal fade right" id="AddDepartment" tabindex="-1" role="dialog" aria-labelledby="AddDepartmentLabel" style="display: none;" aria-hidden="true">
<div class="modal-dialog modal-full-height modal-right" style=" height:auto" role="document">
<!--Content-->
<div class="modal-content">
<!--Header-->
<div class="modal-header" style="color: white; background-color: #212121;">
<h4 class="modal-title w-100 h4-responsive" id="AddDepartmentLabel">Add Department</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true" style="color:white">×</span>
</button>
</div>
<!--Body-->
<div class="modal-body">
<form>
<!-- Material input text -->
<div class="md-form">
@*<i class="fa fa-user prefix grey-text"></i>*@
<input type="text" id="materialFormContactNameEx" class="form-control">
<label for="materialFormContactNameEx">DepartmentName</label>
</div>
<!-- Material input email -->
<div class="md-form">
@*<i class="fa fa-envelope prefix grey-text"></i>*@
<input type="email" id="materialFormContactEmailEx" class="form-control">
<label for="materialFormContactEmailEx">DepartmentCode</label>
</div>
<!-- Material input subject -->
@*<div class="md-form">
<i class="fa fa-tag prefix grey-text"></i>
<input type="text" id="materialFormContactSubjectEx" class="form-control">
<label for="materialFormContactSubjectEx">FacilityType</label>
...
JavaScript
//get html of Departments Modal
$("#AddNewDepartment").on("click", function () {
$.ajax({
url: '/Departments/AddDepartment',
type: "get",
//data: formData,
dataType: "html",
success: function (response) {
//alert(response)
// alert(response.DataBaseOperationStatus);
//$(".modal-backdrop").remove();
$("#AddDepartmentRightModalContainer").empty();
$(response).prependTo($("#AddDepartmentRightModalContainer"))
//initialize dropdown nice look mdbootstrap
$('.mdb-select').material_select('destroy');
$('.mdb-select').material_select();
$('#AddDepartment').modal('show')
}
})
})
</script>
<script>
//$(".closeSelect").on("click", function (e) {
// // $(this).unbind("click");
// e.preventDefault();
//})
$(document).ready(function () {
$(document).on('click', '.closeSelect', function (e) {
// $(this).unbind("click");
e.preventDefault();
//code here
// return false;
});
})