hi
How to create a custom message box. Title,message, O.k button using below code. Line should appear after Title. It should be defined at one place
JavaScript
var swalInit = swal.mixin({
buttonsStyling: false,
confirmButtonClass: 'btn btn-primary',
cancelButtonClass: 'btn btn-light'
});
function ShowPopup(heading, body, type) {
swalInit.fire({
title: heading,
text: body,
type: type,
position: 'top',
allowOutsideClick: false,
timer: 6000
});
}
}Thanks

Amit MohantyRank #112 · 20K reputationPosted Aug 20, 2024, 1:28 AM EDT
var swalInit = Swal.mixin({ buttonsStyling: false, confirmButtonClass: 'btn btn-primary', cancelButtonClass: 'btn btn-light' }); function ShowPopup(heading, body, type) { swalInit.fire({ title: `${heading} `, html: `${body} `, icon: type, position: 'center', // Adjust position as needed allowOutsideClick: false, confirmButtonText: 'OK', timer: 6000 }); }