Easy Tutorial
❮ Jsref Blink Prop Fieldset Type ❯

Input Range autofocus Attribute

Input Range Object

Example

Check if the slider control automatically gains focus after the page loads:

var x = document.getElementById("myRange").autofocus;
true

Definition and Usage

The autofocus attribute is used to set or return whether the slider control automatically gains focus when the page loads.

This attribute reflects the HTML autofocus attribute.


Browser Support

All major browsers support the autofocus attribute.

Note: Internet Explorer 9 and earlier versions do not support the HTML <input> element with the type="range" attribute.


Syntax

Return the autofocus attribute:

Set the autofocus attribute:

Attribute Values

Value Description
true false Describes whether the slider control gains focus after the page loads. <br> true - The slider control gains focus. <br> false - Default. The slider control does not gain focus.

Technical Details

| Return Value: | Boolean, returns true if the slider control automatically gains focus after the page loads, otherwise returns false. | | --- | --- |


Related Pages

HTML Reference: HTML <input> autofocus Attribute


❮ Jsref Blink Prop Fieldset Type ❯