diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index f0104c9156d..5171190d0dd 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -380,8 +380,11 @@ function getSearchElement() {
set_fragment(cur_id);
}
} else if (hasClass(document.getElementById("help"), "hidden") === false) {
- addClass(document.getElementById("help"), "hidden");
- removeClass(document.body, "blur");
+ var is_inside_help_popup = document.getElementById("help").contains(ev.target);
+ if (is_inside_help_popup === false) {
+ addClass(document.getElementById("help"), "hidden");
+ removeClass(document.body, "blur");
+ }
} else {
// Making a collapsed element visible on onhashchange seems
// too late