Hello @peopleinside Here is a EZEE code snip for a css class onclick FUNCTION ENJOY
<script>
document.querySelectorAll('.confirmbuttonclass, .confirmcss2, #etc').forEach(item => {
item.addEventListener('click', event => {
//Peopleinside will Start writing Code here
alert("Hello! This is a demo Alert hahahahha");
//Peopleinside will end code here
})
})
</script>
and If you want custom good looking alert and function only on ok button then here is the JS for that
<script src="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/10.16.6/sweetalert2.all.min.js"></script>
<script>
document.querySelectorAll('.popupwala').forEach(item => {
item.addEventListener('click', event => {
Swal.fire({
title: 'Are you sure you really want to delete peopleinside's file?',
icon: 'warning',
html:
'Are you sure you really want to delete peopleinside's file?',
confirmButtonText:
'OK',
showCancelButton: true,
}).then((result) => {
/* If Result isConfirmed*/
if (result.isConfirmed) {
window.location.href = "https://www.I-am-Afraid-to-share.my-domain/";
/* Here I used redirect function so you can use anything what you want */
}
/* End Result isConfirmed*/
})
})
})
</script>