class HoneyPot {
    constructor() {
        this.forms = document.querySelectorAll('form');
    }

    init() {
        this.forms.forEach(form => {
            this.addHoneyPot(form);
        });
    }

    addHoneyPot(form) {
        let honeypot = document.createElement('input');
        honeypot.setAttribute('type', 'text');
        honeypot.setAttribute('name', 'honeypot');
        honeypot.setAttribute('id', 'honeypot');
        honeypot.setAttribute('tabindex', '-1');
        honeypot.setAttribute('autocomplete', 'off');
        honeypot.setAttribute('style', 'position:absolute;left:-9999px;');
        form.appendChild(honeypot);
    }
}

window.addEventListener('DOMContentLoaded', (event) => {
    let honeypot = new HoneyPot();
    console.log(honeypot);
});
