Here is one type of code:
javascript - jQuery: check if user is using IE - Stack Overflow
Code:
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./))
alert("Its IE");
else
alert("Its NOT IE");