I have few radio inputs with unique id's. Now i have a script that shows some extra content if one of them is checked. It works. But i want to clear that extra content when i check another radio input. This code don't work is i thought. It is not clearing that extra content.
$(document).ready(function () {
$("#delivery_option_5_1").change(function () {
if ($(this).attr("checked")) {
$(".delivery_options").after("<p id='extracontent'>Hello!</p>");
}
else {
$("#extracontent").remove();
}
});
});
I did it like that.
Thx for help. :)