You are here: Reference > HTML > attributes > HIDEFOCUS

HIDEFOCUS attribute

Browser support:
Specifies whether a dotted rectangle (focus rectangle) is drawn around an object while it has focus.
This attribute has effect only for the focus rectangle.
  • If you want prevent the user from interacting with the object, use the DISABLED attribute.
  • If you want prevent the contents of the object from being changed, use the READONLY attribute.
  • In Firefox, Opera, Google Chrome and Safari, you can use the outline style property with a value of 'none' for similar functionality.
JavaScript page for this attribute: hideFocus. You can find other example(s) there.

Possible values:

This attribute has no values.
Specifying the HIDEFOCUS attribute with an arbitrary value has the same effect as specifying it with no value.
For example, all of the following declarations have the same effect: hidefocus, hidefocus="true", hidefocus="false", hidefocus="on", hidefocus="hidefocus".
Although Boolean attributes may be used with no value in HTML, for XHTML compatibility, always use the HIDEFOCUS attribute in the following format: hidefocus="hidefocus".

Example HTML code 1:

This example illustrates the use of the hideFocus attribute:
Use the TAB key to see the difference between the two buttons 
<button>Button With Rectangle</button>
<button hidefocus="hidefocus">Button Without Rectangle</button>
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content