Im trying to make a logout button using a javascript onlick event but I have a syntax error.
<button type="button" tabindex="0" class="dropdown-item" onclick="window.location.href = '/index.php?logout='1'';">Logout</button>
When I implement the link like this is works but this is not the desired implementation as its using a hyperlink instead of the button.
<button type="button" tabindex="0" class="dropdown-item"><a href="/index.php?logout='1'" title="Sign Out">Logout</a></button>
Apologies for the newb question in advance. New at JS :)