【发布时间】:2014-12-15 09:57:03
【问题描述】:
我不知道如何获得我想要的价值我尝试了很多东西,但我不知道如何找到我的价值。 这是我的 HTML:
<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());
});
我已经尝试过和父母一起做更多和更少等等。但我不知道该怎么做。 当我点击按钮 .copyMails 时,我想访问下一个 .lstMails
【问题讨论】:
-
为它制作小提琴
标签: javascript jquery next