<form id="test" onsubmit="return checkParams();" method="post" action="">
<div class="input-inside-label">
<label for="loc">12345</label>
<input class="grab-label" value="" type="text" name="loc" id="loc">
</div>
</form>
입력 한 값이 비어 있습니다. 그러나 나는 그것이 비어있게 제출되기를 원하지 않는다. 양식을 제출하면 레이블의 가치를 파악한 다음 제출하십시오.jquery : 레이블 값 가져 오기
그러나 나는 그 일을 상당히 어렵게 생각합니다. 내가 여기서 뭘 잘못하고 있는거야?
$('#test').submit(function(e) {
if ($(this).children('.grab-label').val() == '') {
$(this).children('.grab-label').val($(this).closest('label'));
}
});
안부 .children()
help를 호출하여,