我在表单提交按钮上使用了 onclick 功能来隐藏 div。但它并没有隐藏。做这个的最好方式是什么?提交表单后,我想在我的页面上隐藏一个 div。
<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>