Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
Internet Explorer
Properties
 hidefocus attribute | hideFocus pro...
hidefocus attribute | hideFocus property

[This documentation is preliminary and is subject to change.]

Sets or gets the value that indicates whether the object visibly shows that it has focus.

Syntax

HTML<element hidefocus="p" ... >
JavaScript

p = object.hideFocus

Property values

Type: Boolean

VARIANT_TRUE (true)

Focus is not visibly indicated.

VARIANT_FALSE (false)

Default. Focus is visibly indicated.

Remarks

The focus of an object is visibly indicated by a focus rectangle—a dotted rectangle within the boundaries of the object.

This property does not control the ability of an object to receive focus; for that, use the tabIndex property.

Examples

The following example shows how to use the HIDEFOCUS attribute to prevent a focus rectangle from appearing on a button.

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/hidefocus.htm

...
<BUTTON>
Button With Rectangle</BUTTON>
<BUTTON HIDEFOCUS="true">
Button Without Rectangle</BUTTON>
...

 

 

Build date: 3/8/2012

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Focus works fine      i_Cypher   |   Edit   |   Show History
response to biggerlugs:

The focus rectangle is removed only within the browser context, the OS context will still show whatever focus mechanism is set in the OS Display properties, in your case a blue rectangle. This attribute works 100% in ie7, and ie8 on systems with no OS display property set for styling focus.
Tags What's this?: Add a tag
Flag as ContentBug
unusable - CONTENTEDITABLE      Mr. Raymond Kenneth Petry   |   Edit   |   Show History
N.B. This property does not indicate the 'inverse-video' of selected text objects in CONTENTEDITABLE.
Hide focus attribute doesn't fully hide the focus      biggerlugs   |   Edit   |   Show History
In the above example, the focus is not fully hidden even on the button with the HideFocus attribute applied to it. When the button with the HideFocus attribute applied receives focus, a blue border is displayed around the button, even though the dotted focus border is not shown. This is under IE8 and the issue occurs irrespective of whether Compatibility View is on or off.
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker