Skip to content

Instantly share code, notes, and snippets.

@pablolobos
Created March 25, 2014 12:21
Show Gist options
  • Save pablolobos/9760779 to your computer and use it in GitHub Desktop.
Save pablolobos/9760779 to your computer and use it in GitHub Desktop.
js_focused-element.js
var focusedElement = document.activeElement;
var triggerElement = document.activeElement;
myModal = new MyModal({
onOpen: function() {
this.container.focus();
},
onClose: function() {
triggerElement.focus();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment