JavaScript Coding Challenge — jQuery Modal Plugin

Write a jQuery plugin for modal window component. Take HTML and CSS from here. So it might look something like the following.


<button type=”button” data-modal=”example-modal”>Open Modal</button> 
<div id=”example-modal”>
// modal html goes here


  • Initialize the plugin on load if element has [data-modal] attribute
  • Close modal when clicked outside the modal window or key ESCAPE is pressed

Use this link as a guide.

Originally published at on March 6, 2017.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.