我不知道如何訪問我想要的值我嘗試了很多東西,但我不知道如何找到我的價值。 這裏是我的HTML:.next(「。myClass」)不工作jquery
<table class="liste">
<tbody>
<tr>
<th>Actions</th>
<th>Nom</th>
<th>Coordonnées</th>
<th>Diplômes</th>
<th>Profil associé</th>
</tr>
<tr>
<td class="groupe" colspan="5">2014-2015
<button class="copyMails" title="Copier les adresses emails">
<img src="/images/picto/action_dupliquer.png" alt="">
Copier les adresses emails
</button>
</td>
</tr>
<tr>
<td>
<input type="text" class="lstMails" value="myText">
</td>
</tr>
<tr>
<th>Actions</th>
<th>Nom</th>
<th>Coordonnées</th>
<th>Diplômes</th>
<th>Profil associé</th>
</tr>
<tr>
<td class="groupe" colspan="5">2014-2015
<button class="copyMails" title="Copier les adresses emails">
<img src="/images/picto/action_dupliquer.png" alt="">
Copier les adresses emails
</button>
</td>
</tr>
<tr>
BLABLABLA
</tr>
<tr>
BLABLABLA
</tr>
<tr>
<td>
<input type="text" class="lstMails" value="myText2">
</td>
</tr>
</tbody>
</table>
這裏是我的JS:
$("body").on('click', ".copyMails", function() {
console.log($(this).parent().parent().parent().next('.lstMails').val());
});
我已經和與多與少等,家長試過,但我不知道如何做到這一點。 我想進入下一個.lstMails當我點擊按鈕.copyMails
製作工作搗鼓它 – Innodel 2014-10-20 12:06:11