353Chapter 15Generic HTML Element Objectsonmouseover= return setStatus( View dictionary definition ) (Web server certificate)

353Chapter 15Generic HTML Element Objectsonmouseover= return setStatus( View dictionary definition ) onmouseout= return setStatus( ) >allegiance to the flag of the United States of America, and tothe Republic for which it stands, one nation under God, indivisible, withliberty and justice for all. Related Items:onmouseenter, onmouseleave, onmousemoveevent handlers. onpasteCompatibility:WinIE5+, MacIE-, NN-, Moz-, Safari- The onpasteevent fires immediately after the user or script initiates a paste edit action onthe current object. The event is preceded by the onbeforepasteevent, which fires prior toany edit or context menu that appears (or before the paste action if initiated by keyboardshortcut). Use this event handler to provide edit functionality to elements that don t normally allowpasting. In such circumstances, you need to enable the Paste menu item in the context or Editmenu by setting the event.returnValuefor the onbeforepasteevent handler to false. Then your onpasteevent handler must manually retrieve data from the clipboard (by way ofthe getData()method of the clipboardDataobject) and handle the insertion into the cur- rent object. Because you are in charge of what data is stored in the clipboard, you are not limited to adirect copy of the data. For example, you might wish to store the value of the srcproperty ofan image object so that you can paste it elsewhere on the page. ExampleListing 15-44 demonstrates how to use the onbeforepasteand onpasteevent handlers (in conjunction with onbeforecopyand oncopy) to let scripts control the data-transfer process during a copy-and-paste user operation. A table contains words to be copied (onecolumn of nouns, one column of adjectives) and then pasted into blanks in a paragraph. Theonbeforecopyand oncopyevent handlers are assigned to the tableelement because theevents from the tdelements bubble up to the tablecontainer and there is less HTML codeto contend with. Inside the paragraph, two spanelements contain underscored blanks. To paste text into theblanks, the user must first select at least one character of the blanks. (See Listing 15-37, which gives a drag-and-drop version of this application.) The onbeforepasteevent handlerin the paragraph (which gets the event as it bubbles up from either span) sets the event. returnValueproperty to false, thus allowing the Paste item to appear in the context andEdit menus (not a normal occurrence in HTML body content). elementObject.onpaste