Im Moment benutze ich jQuery, um alle tds mit dem Edit Link zu verbinden, aber ich möchte nur die tds mit der Klasse bearbeiten können, und ich brauche den Link, um das a Tag mit der Klasse edit- zu finden. Aktion.Jquery td click
Jede Hilfe wäre großartig!
Aktuelle Code:
$("tr.edit").click(function(){
if(!clicking)
{
clicking = true;
$('a.edit-action', this).click();
clicking = false;
}
});
<table align="center" width="100%" id="Table" >
<tr>
<th width="20%">col 1</th>
<th width="20%">col 1</th>
<th width="25%">col 1</th>
<th width="25%">col 1</th>
<th width="10%">col 1</th>
</tr>
<tr class="edit">
<td width="20%" class="edit">name</td>
<td width="20%" class="edit">type</td>
<td width="25%">other 1</td>
<td width="25%">other 2</td>
<td width="10%" class="action"><a href="#" class="dialog edit-action">Edit</a><br>Another delete link here</td>
</tr>
</table>
Dank hat einen Charme! Ich bin ziemlich neu zu jquery, also danke für die Hilfe. –
'.live()' ist das neue Javascript. +1! – JorenB
.on() ist das neue Live()! –