diff --git a/public/js/selftest.js b/public/js/selftest.js
index 2382d237a6c9bb68921869df6b8725ba7eb2743b..c21cf61974290d0a2c77b469be6e5406dd77a26c 100644
--- a/public/js/selftest.js
+++ b/public/js/selftest.js
@@ -251,8 +251,11 @@ function runTest(index, testFunc, fatal=false) {
 
 const logElem = document.getElementById('log');
 logElem.onclick = function() {
-    this.focus();
-    this.select();
+    // select the whole text if nothing was selected yet
+    if (this.selectionStart == this.selectionEnd) {
+        this.focus();
+        this.select();
+    }
 }
 
 function log(msg) {