0

Just like in the topic: how can I display a message (div) when an user uses browsers older than: IE 10, Firefox 39, Chrome 39, Opera 8? Or other words: how can I hide a div when an user uses browsers: IE 10+, Firefox 39+, Oper 8+ ? Thanks in advance for help.

iza_noc
  • 9
  • 1

1 Answers1

0

you can Simply Check the browser details and version after that you can use your condition and implement the method of showing or hiding the div if the condition matched or not ?

function detectBrowser(){ 
    var N= navigator.appName; 
    var UA= navigator.userAgent; 
    var temp; 
    var browserVersion= UA.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i); 
    if(browserVersion && (temp= UA.match(/version\/([\.\d]+)/i))!= null) 
    browserVersion[2]= temp[1]; 
    browserVersion= browserVersion? [browserVersion[1], browserVersion[2]]: [N, navigator.appVersion,'-?']; return browserVersion; 
};
detectBrowser();
Akhilesh Singh
  • 1,724
  • 2
  • 19
  • 35