I was wondering if anyone could figure out why my function won't work properly. What I am trying to achieve is when a button is clicked it displays text and when it is clicked again it hides it and so on.
function hideshow (){
    var showhide=document.getElementById('text');
    if(showhide.style.display="none")
    {
        showhide.style.display="block";
    }
    else{
        showhide.style.display="none";
    }
}
So far I got it to display my text when I click it once, but once I click it again it has no effect on the text.
 
     
     
     
     
     
     
    