YouTip LogoYouTip

Prop Range Autofocus

# Input Range autofocus Property [![Image 8: Input Range Object Reference Manual](#) Input Range Object](#) ## Example Check if the slider control automatically gets focus after the page loads: var x = document.getElementById("myRange").autofocus; The output of _x_ is: true [Try it Β»](#) * * * ## Definition and Usage The autofocus property sets or returns whether a slider control should automatically get focus when the page loads. This property reflects the HTML autofocus attribute. * * * ## Browser Support ![Image 9: Internet Explorer](#)![Image 10: Firefox](#)![Image 11: Opera](#)![Image 12: Google Chrome](#)![Image 13: Safari](#) The autofocus property is supported by all major browsers. **Note:** Internet Explorer 9 and earlier IE versions do not support the HTML element with the type="range" attribute. * * * ## Syntax Return the autofocus property: _rangeObject_.autofocus Set the autofocus property: _rangeObject_.autofocus=true|false ## Property Values | Value | Description | | --- | --- | | true|false | Specifies whether the slider control gets focus after the page loads * true - The slider control gets focus * false - Default. The slider control does not get focus | ## Technical Details | Return Value: | A Boolean. Returns true if the slider control automatically gets focus after the page loads, otherwise false. | | --- | * * * ## Related Pages HTML Reference: (#) * * Input Range Object](#)
← Prop Range DisabledDom Obj Range β†’