Hi,
Please refer below code.
HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript">
function msieversion() {
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
if (msie > 0) {
alert('This site is not compatible in IE please use another browser.');
return false;
}
alert('This site is compatible in current browser');
return true;
}
</script>
</head>
<body onload="return msieversion()">
</body>
</html>
Demo
I hope this will help you out.