I am creating a form and I want that according to the option selected in the menu a different html code is shown on the screen. I'm using jquery to add the new fields. But with each option selected the new fields are concatenated, that is, every time an option is selected a new value is shown, I wanted it to be shown only once. Follow the code.
$(document).ready(function() {
$( ".form-control" ).change(function(){
var varURL = $("option:selected", this).val();
$(".form-group").append('O valor selecionado é: ' + varURL);
});
});