I came across this code snippet
(function ($) {
$.fn.CustomFunction = function (containerId) {
let container = document.getElementById(containerId);
let allFields = container.querySelectorAll("[is-required]");
// More code here....
function AdditionalFunction() {
// Perform actions
}
}
}(jQuery));
To use the CustomFunction, I simply call it like so:
$(this).CustomFunction("container");
The challenge I'm facing is accessing the AdditionalFunction() method. I need to trigger it upon a button click event in order to view the generated errorList obtained from other parts of the CustomFunction.
One way I thought of doing this was by passing another id for a button and binding an event to it to access the errorList. However, I am open to exploring alternative methods to access the AdditionalFunction directly.
I have attempted...