0 out of 12 rated this helpful - Rate this topic

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

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Focus works fine
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.
unusable - CONTENTEDITABLE
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
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.