230Part IIIDocument Objects ReferenceExampleUse The Evaluator (Chapter 13) (Web hosting uk)

230Part IIIDocument Objects ReferenceExampleUse The Evaluator (Chapter 13) to experiment with the hideFocusproperty in WinIE5.5+. Enterthe following statement into the top text field to assign a tabIndexvalue to the myPelement sothat, by default, the element receives focus and the dotted rectangle: document.getElementById( myP ).tabIndex = 1Press the Tab key several times until the paragraph receives focus. Now, disable the focusrectangle: document.getElementById( myP ).hideFocus = trueIf you now press the Tab key several times, the dotted rectangle does not appear around theparagraph. To prove that the element still receives focus, scroll the page down to the bottomso that the paragraph is not visible (you may have to resize the window). Click one of thefocusable elements at the bottom of the page, and then press the Tab key slowly until theAddress field toolbar has focus. Press the Tab key once. The page scrolls to bring the para- graph into view, but there is no focus rectangle around the element. Related Items:tabIndexproperty; srcollIntoView()method. idValue:String.(See text) Compatibility:WinIE4+, MacIE4+, NN6+, Moz1+, Safari1+ The idproperty returns the identifier assigned to an element s idattribute in the HTMLcode. A script cannot modify the ID of an existing element nor assign an ID to an element thatlacks one. But if a script creates a new element object, an identifier may be assigned to it byway of the idproperty. ExampleRarely do you need to access this property in a script unless you write an authoring toolthat iterates through all elements of a page to extract the IDs assigned by the author. You canretrieve an object reference once you know the object s idproperty (via the document. getElementById(elemID)method). But if for some reason your script doesn t know the IDof, say, the second paragraph of a document, you can extract that ID as follows: var elemID = document.getElementsByTagName( p )[1].id; Related Item:classNameproperty. innerHTMLinnerTextValue:String.Read/Write Compatibility:WinIE4+, MacIE4+, NN6+, Moz1+, Safari1+ One way that Internet Explorer exposes the contents of an element is through the innerHTMLand innerTextproperties. (Moz1+/NN6+ offer only the innerHTMLproperty.) All contentdefined by these inner properties consists of document data that is contained by an ele- ment s start and end tags, but not including the tags themselves (see outerTextandouterHTMLproperties). Setting these inner properties is a common way to modify a portionof a page s content after the page loads. The innerHTMLproperty contains not only the text content for an element as seen on thepage, but also every bit of HTML tagging that is associated with that content. (If there are noelementObject.hideFocus