function hapus() {
    return confirm(
        "Apakah Anda yakin ingin menghapus data?"
    );
}

window.onload = function () {
    console.log(
        "Portal Desa Digital Desa Oelomin"
    );
}
console.log("Portal Desa Digital Desa Oelomin");

// Search tabel

const search = document.getElementById("search");

if (search) {

    search.addEventListener("keyup", function () {

        let filter = this.value.toLowerCase();

        let row = document.querySelectorAll("#myTable tbody tr");

        row.forEach(function (item) {

            let text = item.innerText.toLowerCase();

            item.style.display = text.includes(filter) ? "" : "none";

        });

    });

}

// Menu aktif

const menu = document.querySelectorAll(".sidebar li");

menu.forEach(function (item) {

    item.addEventListener("click", function () {

        menu.forEach(i => i.classList.remove("active"));

        this.classList.add("active");

    });

});
