0
Lorsque l'utilisateur appuie sur le texte "Ajouter", alors je voudrais créer une nouvelle ligne avec une balise d'entrée. Je pense que la plupart d'entre elles fonctionnent.jquery Inséré une nouvelle ligne
<!DOCTYPE HTML>
<html>
<head>
<script src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
function OnLoad() {
$('.insert').live('click', function() {
var currentRow = $(this).parents("tr:first");
var newRow = currentRow.clone(true);
// Help need here: change the 3rd table data into an input control
currentRow.after(newRow);
});
}
google.load("jquery", "1");
google.setOnLoadCallback(OnLoad);
</script>
</head>
<body>
<form>
<table border="1">
<tr>
<td class="insert">Add</td>
<td class="delete">Erase</td>
<td>Sample data goes here</td>
</tr>
</table>
</form>
</body>
</html>
Merci! Cela m'a fait démarrer. –