I have a bootstrap 2.32 modal which I am trying to dynamically insert into the HTML of another view. I\'m working with Codeigniter 2.1. Following Dynamically inserting a boo
Other answers din't work for me in my react.js application, so I have used plain JavaScript for this.
Below solution worked:
className="close cursor-pointer" data-dismiss="modal" aria-label="Close" id="myModalClose" > ...
document.getElementById("myModalClose").click();
Possibly you could generate same click on close button, using jQuery too.
Hope that helps.