1
次のjqueryがあります。チェックボックスをオンにすると、フォームに追加のフィールドを入力できるようになります。私がしたいのは、チェックボックスをオフにすると、追加の入力フィールドの値をクリアすることです。チェックボックスがオフの場合、jqueryの入力フィールドをクリアします
$(document).ready(function() {
$('input:checkbox').attr('checked', false);
$('#xml').hide();
$('#checkbox').click(function() {
$('#xml')[this.checked ? "show" : "hide"]();
});
$('input[type="checkbox"]').click(function() {
if (this.checked) {
$('div#xml p label input').attr('required', true);
}
else
$('div#xml p label input').removeAttr('required', true);
//Here should the corresponding code to be pasted
//$('div#xml p label input').val = ('');
});
$(function() {
$("#datepicker").datepicker();
});
});
おかげで多くのことを行う必要があります。いつか私は文法の間で自分自身を失っています – lgt
あなたは歓迎です、それは時々私たちすべてに起こります:) –