this.on('update', function() { this.root.innerHTML = opts.content }) this.options = [ { value: '< 2y', text: "Jag har mindre än två års erfarenhet" }, { value: '> 2y', text: "Jag har mer än två års erfarenhet" } ]; this.options = [ { value: 'kok', text: 'Jag vill jobba i kök' }, { value: 'matsal', text: 'Jag vill jobba i matsal' } ]; this.html = opts.placeholder; this.current = -1; this.options = opts.options; next() { this.current += 1; if (this.current >= this.options.length) { this.current = 0; } var option = this.options[this.current]; this.html = option.text; this.value = option.value; this.update(); } textClass() { if (this.current == -1) { return 'placeholder'; } else { return 'value'; } }