API: Reset Controls

This API allows reset controls by CSS selector and apply it to the content dynamically.

Reset all jPList controls:

<script src="//cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.26.0/polyfill.min.js"></script>
<script src="jplist.min.js"></script>
<script>
    (function(){
        'use strict';

        //start jPList
        jplist.init();

        // DO SOME LOGIC...

        //reset ALL controls
        jplist.resetControls();
    })();
</script>
</html>

Reset all controls of the specified group:

<script src="//cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.26.0/polyfill.min.js"></script>
<script src="jplist.min.js"></script>
<script>
    (function(){
        'use strict';

        //start jPList
        jplist.init();

        // DO SOME LOGIC...

        //reset all controls of the specified group
        const groupName = 'group-1';

        jplist.resetControls(groupName);
    })();
</script>
</html>

Reset one control using it's HTML element:

<script src="//cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.26.0/polyfill.min.js"></script>
<script src="jplist.min.js"></script>
<script>
    (function(){
        'use strict';

        //start jPList
        jplist.init();

        // DO SOME LOGIC...

        //reset the specified control using it's HTML element
        const element = document.getElementByID('my-element');

        jplist.resetControl(element);
    })();
</script>
</html>