On the click handler of a button I want to add a hidden element inside a div :
...
<div id="produits_choisis"></div>
...
<script>
$(document).ready(function(){
$('#btnOne').click(function() { // btnOne is a HTML button
$('#produits_choisis').append("<input type='hidden' id='produit_x' />");
});
...
});
When I click the button then I look the page's source code , but the div produits_choisis is still empty ! So why is it empty ?