diff --git a/js/headfoot.js b/js/headfoot.js index 57b8c104e265f79677c3457f8d8d65ea7b0a773e..45fe882d1e5147445f6aa2e4a3191496a00593d9 100755 --- a/js/headfoot.js +++ b/js/headfoot.js @@ -95,17 +95,10 @@ function head(){ headlink.innerHTML="Account"; headlink.href="/account/"; }else if(document.getElementById('loginswitch').getAttribute('authenticated') == '2'){ - 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); + headlink.setAttribute("th:onclick", "@{/logout}"); + headlink.removeAttribute("href"); + headlink.innerHTML="Logout"; + } }