lundi 23 novembre 2015

Javascript if else display:none

Hello Im working on a Adblocker Script where im stuck now .. Here:

<div class="alert alert-dismissible alert-success">
                  <button type="button" class="close" data-dismiss="alert">×</button>
                  <h2 style="text-align: center;"id="result">AdBlock is</h2>
                </div>
                <script src="dist/js/advert.js"></script>

                <script>
                    if (!('ab' in window)) { window.ab = true; }
                    var result = document.getElementById('result');
                    if (window.ab == true) {
                        result.innerHTML = 'AdBlock is enabled =(';
                    } else {
                        result.innerHTML = 'AdBlock is disabled =)';
                    // Display none the Div element
                    }
                </script>

Thats what i want that after else { it display none the alert.

Aucun commentaire:

Enregistrer un commentaire