I have a form
with a check
that when marked shows a div
with an input with the name of BancoFinanc
, the user can fill this input normally, but would like to uncheck the check the input, if completed by the user, be cleaned.
What I have and what I tried to do was this, but without success:
$(function () { $("#chkFinanciamento").click(function () { if ($(this).is(":checked")) { $("#dvFinanciamento").show(); } else { $("#dvFinanciamento").hide(); // LIMPA VARIÁVEL $("#dvFinanciamento > :BancoFinanc").val(); } }); });
And also this:
$(function () { $("#chkFinanciamento").click(function () { if ($(this).is(":checked")) { $("#dvFinanciamento").show(); } else { $("#dvFinanciamento").hide(); // LIMPA VARIÁVEL $("#BancoFinanc").attr("value",""); } }); });