저는 여러 div가 있고 각 div에는 텍스트 상자와 레이블이 있습니다.Jquery div의 현재 레이블을 가져와 채 웁니다.
$(function() {
$('input:text').focus(function() {
//how do I get the current label and populate with some text? and when clicking on a
//different textbox, I want to clear the previous label and just show the current
//div's label with some data
});
});
예를 들면 : 나는 텍스트 상자 지금까지
스크립트가 .focus에있을 때 라벨에 텍스트를 채울 필요
<div>
@Html.TextBoxFor(model => model.Title)
<label>
</label>
</div>
<div>
@Html.TextBoxFor(model => model.Name)
<label>
</label>
</div>
<div>
@Html.TextBoxFor(model => model.Address)
<label>
</label>
</div>
xx!
정말로 스크린 샷을 게시 할 필요가 없습니다. Google의 브라우저는 페이지를 잘 렌더링합니다. – Blazemonger
정말 저를 믿으십시오. 때때로 정말로 실패합니다. 이전 질문에 많은 코드를 사용하여 답변했으며 모든 코드의 서식을 지정하는 데 시간을 낭비했습니다. –
실제 코드를 넣는 지점은 사람들이 쉽게 복사하여 붙여 넣을 수 있기 때문입니다. 내일 이미지 호스팅 서비스가 제공 될 것이라는 보장이 없습니다. SO가 내장하고있는 코드 포맷 도구를 사용하는 방법을 배우면됩니다. – Blazemonger