Відмінності між версіями «Шаблони заяв та клопотань»

Перейти до навігації Перейти до пошуку
Рядок 4: Рядок 4:
</head>
</head>
<body>
<body>
 
mw.loader.load('/index.php?title=MediaWiki:Example.js&action=raw&ctype=text/javascript');
<script>
function tableSearch() {
    var phrase = document.getElementById('search-text');
    var table = document.getElementById('info-table');
    var regPhrase = new RegExp(phrase.value, 'i');
    var flag = false;
    for (var i = 1; i < table.rows.length; i++) {
        flag = false;
        for (var j = table.rows[i].cells.length - 1; j >= 0; j--) {
            flag = regPhrase.test(table.rows[i].cells[j].innerHTML);
            if (flag) break;
        }
        if (flag) {
            table.rows[i].style.display = "";
        } else {
            table.rows[i].style.display = "none";
        }
 
    }
}
</script>
<input class="form-control" type="text" placeholder="ПОШУК..." id="search-text" onkeyup="tableSearch()">
<input class="form-control" type="text" placeholder="ПОШУК..." id="search-text" onkeyup="tableSearch()">
<table class="table table-striped" id="info-table" width=95% border="1" align="center" style="border-collapse:collapse" cellpadding="3">
<table class="table table-striped" id="info-table" width=95% border="1" align="center" style="border-collapse:collapse" cellpadding="3">