diff --git a/js/headfoot.js b/js/headfoot.js
index 0db98174c87ccf12350a9a783591d9ba28d504d0..9113c3749ebc4ea71a00a19c863c55805e811eca 100755
--- a/js/headfoot.js
+++ b/js/headfoot.js
@@ -95,8 +95,17 @@ function head(){
                 headlink.innerHTML="Account";
                 headlink.href="/account/";
             }else if(document.getElementById('loginswitch').getAttribute('authenticated') == '2'){
-                headlink.innerHTML="Logout";
-                headlink.href="./logout";
+                headlink.remove();
+                let headform = document.createElement('form');
+                headform.setAttribute("th:action", "@{/logout}");
+                headform.setAttribute("method","POST");
+                let headbutton = document.createElement('button');
+                headbutton.name='logout';
+                headbutton.type="Submit";
+                headbutton.innerHTML= "Logout";
+                headbutton.classList.add("btn","btn-md", "btn-danger");
+                headform.appendChild(headbutton);
+                headitem.appendChild(headform);
             }
             
         }