How would I make my side menu open when I use the arrow keys? Right arrow key opens it left arrow key closes it.
Here's the code of how my menu opens and closes:
<script>
function toggle() {
if( document.getElementById("hidethis").style.display=='none' ){
document.getElementById("hidethis").style.display = '';
}else{
document.getElementById("hidethis").style.display = 'none';
}
</script>
I have looked into this topic but not been able to find anything that relates directly to me if you could maybe show me or point me in the right direction that would be great. I'm sure you could do this with some sort of keydown function just not sure how.