onsave Event

This sample will demonstrate how the onsave event can be used with persisting objects.

Enter a value and save this page as a favorite. When you save the page, the onsave event will be used to call the setAttribute method, which in turn allows the information to persist.

Since saveFavorite requires that information be set using the setAttribute and getAttribute methods, there are various event handlers that should be kept in mind that may be used. This example will use the first combination (others are listed as suggestions):

  1. onsave and onload, two persistence-specific event handlers.
  2. onclick and onblur.
  3. onmouseover and onmouseout

Enter some text:



© 1999 Microsoft Corporation. All rights reserved. Terms of use.