Skip to content

Instantly share code, notes, and snippets.

@nappa7878
Created February 6, 2013 03:25
Show Gist options
  • Save nappa7878/4719985 to your computer and use it in GitHub Desktop.
Save nappa7878/4719985 to your computer and use it in GitHub Desktop.
function onoffSelect_focus(obj){
var userAgent = window.navigator.userAgent.toLowerCase();
if(userAgent.indexOf("msie") > -1) {
obj.focus();
obj.select();
}else if(userAgent.indexOf("firefox") > -1) {
obj.focus();
obj.select();
}else if(userAgent.indexOf("opera") > -1) {
obj.focus();
obj.select();
}
}
function onoffSelect_click(obj){
var userAgent = window.navigator.userAgent.toLowerCase();
if(userAgent.indexOf("chrome") > -1) {
obj.focus();
obj.select();
}else if(userAgent.indexOf("safari") > -1) {
obj.focus();
obj.select();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment