function Commander(element,element_input) { this.element = element; this.element_input = element_input; this.show = function() { this.element.setAttribute('class','visible'); this.element_input.focus(); } this.hide = function() { this.element.setAttribute('class','hidden'); } this.validate = function() { console.log(this.element_input.value); } }