I have some bug with the following page: http://jsbin.com/agedu/ Source code with some comments: http://jsbin.com/agedu/edit
The problem is that when typing somethin
When you initialize your plugin, you were setting resetting the value of the inputs, I just refactored a bit and added the following check:
if (this.value === '' || this.value === hvalue){
$(this).attr('value', hvalue).addClass(opts.hclass);
}
I separated that operations from your focus event connection chain.
Now it will only set the default value (hvalue) and the default gray class (hclass) if the element value is ''
or it has the default value.
Check your snippet here.