I have a problem with the following JS function:
function toggleSortierung() {
var form =document.getElementById("sortieren_form");
if(form.style.display=="none") {
document.getElementById("sortieren_form").style.display="block";
}
else {
document.getElementById("sortieren_form").style.display="none";
}
}
This is toggling the visibility of a form on and off. The form is not visible on default. The function is integrated into a link:
<a href="javascript:toggleSortierung()">Sortierung:</a>
The function actually works, but the very first click on the link is doing nothing, although it should make the form visible. After the first click the function works like expected, so it only hinders smooth usability.