Quantcast
Channel: Latest Free Bootstrap 5/4/3 Extensions & Plugins - CSS Script
Viewing all articles
Browse latest Browse all 164

Create Bootstrap 5 Modals With Custom Actions

$
0
0
Create Bootstrap 5 Modals With Custom Actions

A simple Bootstrap extension that enables you to dynamically create Bootstrap 5 modal popups with custom actions.

How to use it:

1. Download and load the main script modal-with-custom-action.js into your Bootstrap 5 project.

// Bootstrap 5 Files
<link rel="stylesheet" href="/path/to/cdn/bootstrap.min.css" />
<script src="/path/to/cdn/modal-with-custom-action.js"></script>

// Custom Modal JavaScript
<script src="modal-with-custom-action.js"></script>

2. Display a Bootstrap 5 modal window on the screen. Possible parameters:

// showModal(title, description, yesBtnLabel = 'Yes', noBtnLabel = 'Cancel', callback)
showModal('File Deletion', 'Do you want to delete this file?', "Yes", "No", () => {
  console.log('File deleted successfully');
});

The post Create Bootstrap 5 Modals With Custom Actions appeared first on CSS Script.


Viewing all articles
Browse latest Browse all 164

Trending Articles