How to write this from javascript to JQuery : <p>Simple question I need these few lines of javascript in jquery.
Just trying to close a modal when I select outside of it.</p>

<p>Thank you.</p>

<pre><code> // When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
 if (event.target == myModal) {
    myModal.style.display = "none";
}
}
</code></pre>
