我想要创建一个函数,它提交所有的公式,并选中一个复选框,并隐藏它们各自的div标记。
我以下面的代码为例
<html>
<script>
//the jquery function to submit all forms
$(function () {
$(".formerasemessage").each(function () {
var par_div = $(this).closest(".demo"); //finding the closest div
$(this).validate({
submitHandler: function (formbeingsubmitted) {
$.post('remove.php', $(formbeingsubmitted).serialize(), function (data) {
$(formbeingsubmitted).hide("slow");
par_div.hide('slow'); //hide the div
});
}
});
});
});
</script>
<body>
<div class="demo">
<form method="post" class="formerasemessage">
<input type="checkbox" id="checkItem"></form>
</div>
<div class="demo">
<form method="post" class="formerasemessage">
<input type="checkbox" id="Checkbox1"></form>
</div>
<div class="demo">
<form method="post" class="formerasemessage">
<input type="checkbox" id="Checkbox2"></form>
</div>
<input type="button" value="Submit all checked">
</body>
</html>我需要重新编写Jquery函数,以便它能够执行所需的函数。
视觉效果会是这样的:

这是我的Outlook收件箱,检查了我的邮件,然后我点击‘删除’,我的邮件被隐藏和删除
发布于 2015-04-28 17:17:11
您可以使用document.getElementById("inputid").value调用输入。若要隐藏任何内容,请使用css代码:#inputid {能见度:隐藏}--您还可以使用javascript存档相同的效果。存档来执行js函数,例如:我可以被点击
您可以在网上找到几个选项(W3schools),例如onclick、onmousein、onchange .
https://stackoverflow.com/questions/29925422
复制相似问题