http://lmgtfy.com/?q=how+to+detect+a+user+browser or alternativly search for javascript browser detect. There are alot of examples in the first links
Then check for example this link from the search result: http://www.javascriptkit.com/javatutors/navigator.shtml There are example codes and it's described how they work. Just copy them and then try and see how they work As an example a simple brwoser detect function built from the examples on page i linked: <script type="text/javascript"> function detectBrowser() { var browser; if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)) { //test for Firefox/x.x or Firefox x.x (ignoring remaining digits) browser = "Firefox" } else if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { //test for MSIE x.x; browser = "MSIE"; } else if (/Opera[\/\s](\d+\.\d+)/.test(navigator.userAgent)) { browser = "Opera"; } else { browser = "Browser could not be detected!"; } return browser; } alert(detectBrowser()); </script> Code (markup): Hope this gets you started