Hello Claude,
it works with the direct setting of the complete HTML attribute 'style'.
In addition, you also have to take care of the existing event handler.
So first remove the existing handler and then attach your own.
Your custom event handler is nothing more than a copy of the original minus the one line that hides the anchor.
The following code works for me:
Code:
jQuery(document).ready(function() {
jQuery('.clear-selection').each(function() {
jQuery(this).attr("style", "display: block;");
jQuery(this).off('click');
});
jQuery("a.clear-selection").on("click", function(e) {
let uploadid = jQuery(this).attr('data-clear-target');
let el = jQuery('#' + uploadid);
el.replaceWith(el.val('').clone(true));
// get the new jQuery object of el
el = jQuery('#' + uploadid);
el.trigger('keyup');
e.preventDefault();
return false;
});
});
Kind regards, Ingmar[/code]