내 HTML 구조는 다음과 같은 형태 TD의 내용을 확인하는 방법은 다음과 같습니다jQuery를 선택기
<div id="mainDiv">
<table></table>
<table></table>
<table>
<tr>
<td id="first">FirstCell</td><td id="second">SecondCell</td>
</tr>
<tr>
<td></td><td></td>
</tr>
</table>
</div>
지금 내가 먼저 TD의 값에 따라 두 번째 TD의 콘텐츠를 찾을 싶습니다.
나는 다음과 같이 시도했지만 작동하지 않는 것 같습니다.
$("#mainDiv tr td:contains('first')").each(function(){
var secondCell = $(this).find('#second').value();
});
모든 도움을 주실 수 있습니다.
'var secondCell = $ (this) .find ('# 초') .var secondCell = $ (this) .next(). text();' –