I´m having problems with a JQuery on click event over a dynamically created element.
The code created dynamically is this:
<div class="container rounded">
<div class="message_area" style="background-color: #dff0d8;border:1px solid #d6e9c6; color: #3c763d">
<button class="close" type="button">x</button>
Ya esta suscrito a nuestras listas de envío, sus datos han sido actualizados.
</div>
</div>
And I´m trying yo change the height of a container (class bloqFormulario) when the client click on the close button.
I have tried these options:
(function($){
$(".close").click(function() {
$(".bloqFormulario").height(200);
});
})(jQuery);
(function($){
$(".message_area").on("click", "button", function() {
$(".bloqFormulario").height(200);
});
})(jQuery);
But I have no result.
Can you help me?
Thanks a lot.