Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

check Browser version js

<!DOCTYPE html>
    <html>
    <body>
    <p>What is the name(s) of your browser?</p>
    <button onclick="myFunction()">Try it</button>
    <p id="demo"></p>
    <script>
    
    function myFunction() { 
     if((navigator.userAgent.indexOf("Opera") || navigator.userAgent.indexOf('OPR')) != -1 ) 
    {
        alert('Opera');
    }
    else if(navigator.userAgent.indexOf("Edg") != -1 )
    {
        alert('Edge');
    }
    else if(navigator.userAgent.indexOf("Chrome") != -1 )
    {
        alert('Chrome');
    }
    else if(navigator.userAgent.indexOf("Safari") != -1)
    {
        alert('Safari');
    }
    else if(navigator.userAgent.indexOf("Firefox") != -1 ) 
    {
         alert('Firefox');
    }
    else if((navigator.userAgent.indexOf("MSIE") != -1 ) || (!!document.documentMode == true )) //IF IE > 10
    {
      alert('IE'); 
    }  
    else 
    {
       alert('unknown');
    }
    }
    </script>
    
    </body>
    </html>
Comment

PREVIOUS NEXT
Code Example
Javascript :: html onchange call js function 
Javascript :: vanilla javascript change background color 
Javascript :: how to get range slider value in javascript 
Javascript :: window resize next js 
Javascript :: ngrok live port vue js 
Javascript :: user input in js 
Javascript :: usereducer hook 
Javascript :: detect click outside react component 
Javascript :: javascript progress of xml http request 
Javascript :: react native red triangle up 
Javascript :: using async function in useeffect 
Javascript :: what is functional composition 
Javascript :: export table data to excel in jquery 
Javascript :: moment timezone set clock in another timezone 
Javascript :: open modal useState 
Javascript :: app script map fit markers 
Javascript :: how to read a csv file in nodejs 
Javascript :: hash object javascript 
Javascript :: react-active link 
Javascript :: get position of element in react 
Javascript :: mysql json_array_append 
Javascript :: img src to file javascript 
Javascript :: disable button js 
Javascript :: mongoBD increment 
Javascript :: reverse array without using another array js 
Javascript :: antd react native 
Javascript :: javascript count character in string 
Javascript :: axios httponly cookie 
Javascript :: javascript check if property exists in object 
Javascript :: ace editor set theme 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =