I have 3 radio buttons let's say A,B,& C. when i click on the B a new section will come having some other form fields. and most important part is that i have to append/ repeat the entire part by an add more button and the whole functionality is as previous. but in the append filed the show hide function is not working.
It is better to show a code snippet so it is easy for us to guide you. But try this code. Register the click event of the button using $(document).on('click', 'element', function);
$(function(){
$('#btnAddMore').on('click', function(){
$(".repeater").append($('.template').html());
});
$(document).on('click', '[data-containerId="alertme"]', function(){
alert("Hello world!");
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="template">
<input type="submit" data-containerId="alertme" value="alert me" />
</div>
<div class="repeater">
</div><div>
<button id="btnAddMore">add more</button>
</div>