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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Formulaire jQuery</title>
</head>
<body>
<form action="/ma-page-de-traitement" method="post">
<!--<div>
<input type="text" style="width:25px;" id="recherche /">
</div>!-->
<div class="id">
<label for="ID">ID</label><br>
<div id="ligne">
<input type="text" style="width:25px" value="0" id="ID" />
</div>
</div>
<div class="produit">
<label for="produit">Produit</label><br>
<div id="ligne">
<input type="text" style="width:160px" id="produit" />
</div>
</div>
<div class="prix">
<label for="prix">Prix</label>
<div id="ligne">
<input type ="text" style="width:80px" id="prix" />
</div>
</div><br>
<div id="ligne">
<button type="button">+</button>
</div>
<!--<div class="button">
<button type="submit">Envoyer votre message</button>
</div>!-->
</form>
<script src="jquery.js"></script>
<script>
$(document).ready(function($){
$('#button').click(function(e){
var copie = $('.ID').clone();
copie.appendTo('body');
});
});
</script>
</body>
</html>
<style type="text/css">
.id {
position: relative;
text-align:center;
width:45px;
height:400px;
display:block;
float:left;
}
.produit {
position:relative;
text-align:center;
width:180px;
height:400px;
display:block;
float:left;
}
.prix {
position:relative;
text-align:center;
width:100px;
height:400px;
display:block;
float:left;
}
#ID {
}
</style> |
Partager