Please help me with this problem I want that when I select the option the element will show. But it happen it didn't work even when I add new select tag the code didn't work. Here is my code.
<div id="ugh">
<select class="handicap">
<option value="a"> Example 1</option>
<option value="b"> Example 2</option>
</select>
<div id="ahh">
<div class="row">
<div class="inputs">
</div>
</div>
</div>
</div>
<a id="sigepapa" class="fa fa-clone"></a>
<script>
$('#sigepapa').click(function(){
var ako ='';
ako += '<select class="handicap">';
ako += '<option value="a">Example 1</option>';
ako += '<option value="b"> Example 2</option>';
ako += '</select>';
ako += '<div id="ahh">';
ako += '<div class="row">';
ako += '<div class="inputs">';
ako += '</div>';
ako += '</div>';
ako += '</div>';
$('#ugh').append(ako);
});
</script>
<script>
$(document).ready(function()
{
$('.handicap').change(function()
{
var val = $(this).val();
if(val == 'a')
{
$('#ahh').html('<div class="row"><div class="inputs"><input type="text" name="mc" class="ja"></div></div>');
}
else
{
$('#ahh').html('<div class="row"><div class="inputs"><input type="text" name="cb" class="ja"></div></div>')
}
});
});
</script>
I want that when I select the element will show depending on the select value. And also when I add new select tag the element will show depending on the select value