Intercepter le click sur une cellule du tableau ?
Bonjour,
Je souhaiterai intercepter le click sur une cellule du tableau, voici mon code qui ne fonctionne pas :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript">
$('table td').click(
function()
{
alert('ok!');
}
);
</script>
</head>
<body>
<table>
<tr>
<td>001</td>
<td>002</td>
</tr>
<tr>
<td>003</td>
<td>004</td>
</tr>
</table>
</body>
</html> |
Pouvez-vous m'aider à comprendre et corriger ce qui ne va pas ?
Merci,
ZiP