diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index 7c00cf940c7..1519392ab74 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -161,7 +161,7 @@ function hideThemeButtonState() {
outputElement: function() {
return document.getElementById("search");
},
- title: null,
+ title: document.title,
titleBeforeSearch: document.title,
timeout: null,
// On the search screen, so you remain on the last tab you opened.