Skip to content

Instantly share code, notes, and snippets.

@mattlockyer
Created October 23, 2020 22:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattlockyer/f9ff385ea3aded9452fe54c5f37bce9a to your computer and use it in GitHub Desktop.
Save mattlockyer/f9ff385ea3aded9452fe54c5f37bce9a to your computer and use it in GitHub Desktop.
Quick Modal for Developer Console
modal = document.createElement('div')
modal.innerHTML = '<span id="close-modal">x</span>'
style = modal.style
modal.style.zIndex = 1000
modal.style.width = modal.style.height = '90%'
modal.style.background = 'white'
modal.style.position = 'absolute'
modal.style.top = modal.style.left = '5%'
modal.style.padding = '16px'
document.body.appendChild(modal)
document.getElementById('close-modal').onclick = () => document.body.removeChild(modal)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment