I am using the following Jquery Code
(function ($) {
$('.afc_close_content').click(function() {
var afc_content_id = $(this).closest('div').attr('id');
$('#'+afc_content_id).hide();
});
})(jQuery);
I have change it JavaScript
(function () {
document.getElementByClassName("afc_close_content").click(function() {
let afc_content_id = this.closest('div').attr('id');
$('#'+afc_content_id).style.display = "none";
});
});
But the above code does not work
Where am I wrong?