Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

close bootstrap modal with javascript

$('#myModal').modal('hide');
Comment

modal dismiss

<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalCenter">
  Launch demo modal
</button>

<!-- Modal -->
<div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
  <div class="modal-dialog modal-dialog-centered" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLongTitle">Modal title</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">×</span>
        </button>
      </div>
      <div class="modal-body">
        ...
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div>
  </div>
</div>
Comment

when modal close event

$("yourid").on('hide.bs.modal', function(){
	// do it here
});
Comment

bs modal service close

this._bsModalRef.hide();
Comment

Close Modal

 .close.mat-button {
    position: absolute;
    top: 0;
    right: 0;
    padding: 5px;
    line-height: 14px;
    min-width: auto;
}
   <button class="close" mat-button [mat-dialog-close]="true">X</button>

Comment

PREVIOUS NEXT
Code Example
Javascript :: react-native-screens 
Javascript :: detect if two line segments intersect each other javascript 
Javascript :: node js example 
Javascript :: turn Iterator into array JS 
Javascript :: how to scroll to an element javascript react 
Javascript :: get client id socket io 
Javascript :: javascript scroll to top 
Javascript :: getcomputedstyle 
Javascript :: addclass removeclass jquery 
Javascript :: javascript log html element as dom object 
Javascript :: node.js express post query string 
Javascript :: cannot use import statement outside a module 
Javascript :: jquery set hidden field value 
Javascript :: react string to integer 
Javascript :: set a value in session using javascript 
Javascript :: javascript queryselector child element 
Javascript :: creating a 2d array in js 
Javascript :: convert to 24 hours format javasript 
Javascript :: create react native 
Javascript :: handlerbar console log 
Javascript :: nullish coalescing js 
Javascript :: toggle boolean js 
Javascript :: set default date today js 
Javascript :: how to add seconds to time in js 
Javascript :: urlencoded limit nodejs express 
Javascript :: how to remove last element in js 
Javascript :: js host without port 
Javascript :: remove id attribute javascript 
Javascript :: node js download file to folder 
Javascript :: react state array 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =