Alert on only certain browser

2

Is it possible only with JavaScript and HTML to display a alert only and only when the user is browsing Internet Explorer?

For example when you browse Google Chrome alert does not appear, but when you browse Internet Explorer

    
asked by anonymous 03.07.2017 / 16:21

1 answer

2

Possible to get browser properties:

function identificarBrowse() {
    var nav = navigator.userAgent.toLowerCase();
    if (nav.indexOf("msie") != -1) {
        alert("IE");
    }
}

Note

How to identify IE11 has changed, I used the Joachim solution:

JSFiddle: link

    
03.07.2017 / 16:27