I am using a onclick function on my form submit button to hide a div. but it is not hiding. what is the best way to do this? I want to hide a div on my page, after submitting a form.
<form action="" method="POST">
<input type="submit" onclick="hide_group_posts();">
</form>
<div id='div_i_want_to_hide'>
<?php include $_SERVER['DOCUMENT_ROOT']."page.php";?>
</div>
<script>
function hide_group_posts(){
$('#div_i_want_to_hide').hide();
}
</script>
If it didn’t help you, one of the following must be true:
Prevent it like this: