EDITABLE CODE:
LiveDemo:jQuery - Error Event using error() Method
Note: The parameter within the function is executed each time the event is triggered.