I need to hide the form on submit
<form id="details_form" class="form-horizontal" role="form">
and show the game "pacman"
<div id="pacman"></div>
I'm using style.display property to hide and show the div and the form
$(document).ready(function() {
_("pacman").style.display = "none";
$("form").submit(function(e) {
_("details_form").style.display = "none";
if(_("details_form").style.display === "none"){
_("pacman").style.display = "block";
}
return false; // prevents page refresh! :) yay!!
});
});
I've also hosted it on a server and checked. But with the same result. What's happening? Check my code on Github