could someone tell me what is wrong with my code below please? I want 'the_text' to be visible or invisible on the button click. The mystyle.css has:
#the_text {
visibility: hidden;
}
And my html page:
<html> <head> <link rel="stylesheet" type="text/css" href="mystyle.css"> </head> <body> <button type="button" onClick = "check_this_out()">Show/hide</button> <div id="the_text"> I want to hide this by pressing the button above</div> <script> function check_this_out() { var vis_or_hidden = document.getElementById("the_text"); if vis_or_hidden.style["visibility"] = "hidden" {vis_or_hidden.style["visibility"] = "visible"} else {vis_or_hidden.style["visibility"] = "hidden"} } </script> </body> </html>