Clearing field when clicking the icon

The following example shows how to clear the field when clicking the feedback icon.
const fv = FormValidation.formValidation(
document.getElementById('demoForm'),
{
fields: {
...
},
plugins: {
...
icon: new FormValidation.plugins.Icon({
valid: 'fa fa-check',
invalid: 'fa fa-times',
validating: 'fa fa-refresh',
onPlaced: function(e) {
// e.field is the field name
// e.iconElement presents the icon element
e.iconElement.addEventListener('click', function() {
// Reset field when clicking on the associated icon
fv.resetField(e.field);
});
},
}),
},
}
);
Clearing field when clicking the icon