it looks very clean and logic, but where to place it. I have a ccs contact site, and I can make none to work. I just want the names: “Name, Email, and content appear grey inside the boxes, but for some reason non of the examples given work. To correct this for onblur, a flag variable can be declared and initialized to false. When the event handler for onblur is triggered, if the flag is set to false, the function is executed and the flag is set to true. Otherwise, it does nothing. Then, the event handler for onfocus can set the flag to false again. The solution is similar for onfocus. Bootstrap widgets for Angular: autocomplete, accordion, alert, carousel, dropdown, pagination, popover, progressbar, rating, tabset, timepicker, tooltip, typeahead The exact handling of the unload event has varied from version to version of browsers. For example, some versions of Firefox trigger the event when a link is followed, but not when the window is closed. A redirect to another topic doesn't answer the question. The other topic has the same flawed answer. "Call 'textbox' method to get the text box, you will be able to bind any events on it."